Extensions

Examples of how the API's will work for CRUD (Create, Read, Update, Delete) for any of the attributes on the Vodia PBX. These can be used by the developers to create numerous functionalities with help of the APIs like, creating your own web interface completely from the scratch, remote controlling a system from a server, craeting classroom extension, trunks etc. Also, this can be done using any language of your choice. You can also make this as a part of the CRM software you support for e.g. creating an extension on-the-go for a hotel management system from the details of the customer provided.

Extensions

GET extension's settings

GET
 
/rest/domain/{domain_name}/user_settings/{extension_number}

Parameters

Field Type Description
domain_name String Name of the existing domain.
extension_number Int Number (id) of the existing extension

Success Response (200 OK)

Example:

curl -u admin:password GET -D - http://127.0.0.1:8080/rest/domain/localhost/user_settings/440
	{
	access_level: "0",
	active_calls: "",
	actsync_address: "",
	actsync_calendar: "",
	actsync_cert: "",
	actsync_room: "",
	actsync_timer: "",
	actsync_username: "",
	admin: "",
	adrbook_pref: "",
	anonymous: "",
	auth_adr: "",
	avail: "",
	barge: "",
	block_cid: "false",
	bob: "false",
	call_redial: "sip:443@localhost",
	call_return: ""GXP 1628" sip:443@localhost",
	callback: "",
	carddav_email: "",
	cell_acd: "",
	cell_always: "",
	cell_c2d: "",
	cell_callback: "",
	cell_callback_dest: "",
	cell_conn: "",
	cell_dis: "",
	cell_hunt: "",
	cell_in: "",
	cell_mwi: "false",
	cell_never: "",
	cell_night: "",
	cell_pause: "",
	cell_retries: "",
	cell_time: "",
	cfa: "",
	cfa_times: "",
	cfb: "",
	cfb_times: "",
	cfd: "",
	cfn: "",
	cfn_timeout: "",
	cfn_times: "",
	cfr: "",
	checked_in: "false",
	cleanup: "",
	codecs: "",
	crm_address: "",
	crm_type: "",
	crm_username: "",
	cw: "true",
	dial_plan: "",
	display_name: "",
	disturb: "",
	dnd: "false",
	dnd_cust_reason: "",
	dnd_reason: "",
	door_url: "",
	eani: "",
	edest: "",
	email_address: "",
	email_all: "",
	email_black_call: "",
	email_mb_full: "",
	email_missed: "",
	email_recadr: "",
	email_status: "",
	email_vmail: "",
	euse: "",
	extcall: "",
	extts: "",
	fax: "",
	first_name: "Snom 820",
	hours_fri: "",
	hours_holiday: "",
	hours_mon: "",
	hours_sat: "",
	hours_sun: "",
	hours_thu: "",
	hours_tue: "",
	hours_wed: "",
	hunt: "",
	include_local: "true",
	lang_audio: "",
	lang_web: "",
	lastcall: "1498595251.742",
	lines: "",
	listen: "",
	log_register: "9",
	lync_authname: "",
	lync_username: "",
	lync_uuid: "",
	mac: "",
	mailbox_access: "",
	mailbox_escape: "",
	mailbox_escape9: "",
	mailbox_group: "",
	max_regs: "",
	mb_enable: "true",
	mb_offer_cell: "",
	mb_play_env: "",
	mb_size: "",
	mb_timeout: "",
	melody: "",
	moh: "",
	mwi: "true",
	name_use: "false",
	no_vpa: "",
	num_acds: "",
	orbits: "",
	pcall: "",
	pcap: "false",
	pcc: "",
	personal: "",
	personal_greetings: "1 446 8",
	pickups: "",
	picom: "",
	picture: "",
	playrec: "",
	pnp_open: "873af39063340100",
	position: "",
	predir: "",
	presence: "",
	profile: "1",
	profilename: "Akuvox SP-R63G",
	rec_911: "",
	rec_extension: "",
	rec_external: "",
	rec_internal: "",
	showacd: "",
	sip_hist: "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4 88334fb045e40ad77bb51a1c0e4801f77d54e55132b7a951d95473b57b1912e0",
	siptrans: "",
	super_mwi: "false",
	super_number: "",
	super_pause: "60",
	super_retries: "3",
	tagline: "",
	teach: "",
	total_reg: "343361",
	tz: "",
	ua_type: "",
	use_acd_dp: "false",
	vm_indicator: "7/0 (0/0)",
	vmail_option: "",
	wakeup: "",
	wakeup_fail_email: "",
	web_hist: "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4 7a5cef8ececde7adead3ec9df9646f5ec04b7cd19d7269e720b4d7870386cf0b",
	wrtc_register: "",
	acdani: "",
	ani: "",
	cdr_time: "",
	credit: "",
	dialog_state: "",
	dialog_subscribe: "",
	dialog_version: "",
	disabled: "",
	email_cdr: "",
	epid: "5827991637",
	location: "",
	max_call_duration: "",
	max_cdrs: "",
	need_license: "",
	param1: "",
	param2: "",
	param3: "",
	rb: "",
	rf: "",
	view_settings: "",
	visible: "",
	alias: [
	"446"
	]
}

As seen, the response code list can be huge depending on the page (For e.g API being fired for an extension, AA, ACD etc.)

Error Codes

Field Code Description
Invalid supplied 400 Username or password supplied are incorrect
Permission Denied 403 Only authenticated users can access the data.
Not Found 404 The id of the User was not found or there are errors in the URL.

 

CREATE Extension(s)

post
/rest/domain/domain_name/addacc/extension_number

Parameters used

Field Type Description
domain_name String Name of the existing domain.
extension_number Int Extension number to be deleted

 

Example:

Request:

curl -u admin:password -D - http://127.0.0.1:8080/rest/domain/localhost/addacc/447 -X POST -d
"{
'type':'extensions',
'account_ext':'447',          
'first_name':'Nikola',     
'last_name':'Tesla',           
'cell':'(777)788-8800',      
'email':'telephone@bsnl.com', 
'mac':'AABBCCDDEEFF' 
}"

Response:

Response Code Description
Success 200 OK
Invalid ID supplied 400 Only authenticated Admins can access the data
Permission Denied 403 Forbidden
Not Found 404 The id of the User was not found or there are errors in the URL.

 

UPDATE Extension(s)

post
/rest/domain/domain_name/user_settings/extension_number

Parameters used

Field Type Description
domain_name String Name of the existing domain.
extension_number Int Extension number to be deleted

Example:

Request:

curl -u admin:password -D - http://127.0.0.1:8080/rest/domain/localhost/user_settings/447 -X POST -d
"{
'anonymous':'reject',                 
'cell_acd':'unreg',                   
'cell_c2d':'true',                   
'cell_callback':'true',               
'cell_dis':'(779)1111-222',   
'cell_hunt':'unreg',         
'cfa':'54367356',
'no_vpa':'false'
'bob':'true'
'cfr':'545',
'dnd':'false'
}"

Response:

Response Code Description
Success 200 OK
Invalid ID supplied 400 Only authenticated a Admins can access the data
Permission Denied 403 Forbidden
Not Found 404 The id of the User was not found or there are errors in the URL.

 

DELETE Extension(s)

The extension numbers in the API call below can be obtained using the GET for an entire list of Extensions

 

There are 2 ways of deleting an entry.

1) Delete, multiple accounts (extension, auto-attendant, agent-groups etc. together) at once.

post
/rest/domain/domain_name/domain_action

Parameters used

Field Type Description
domain_name String Name of the existing domain.
account_number Int Account number to be deleted

 

Example:

Request:

curl -u admin:password -D - http://127.0.0.1:8080/rest/domain/localhost/domain_action -X POST -d
"{
'type':'accounts',
'action':'delete_selected',
'selected':'446 447'
}"

2) Delete, single account at a time.

post
/rest/domain/domain_name/addacc/account_number

Request:

curl -u admin:password -D - http://127.0.0.1:8080/rest/domain/localhost/addacc/66 -X DELETE -d
"{
'type':'extensions',
'account':'66'
}"

Response (for both cases):

Code Description
200 OK
400 Invalid user supplied
404 User not found

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.