Vodia PBX API (version 58.0 and above)

Hunt Groups

GET (Getting the Hunt Group's list)

GET

1) Info of the entire list of the Hunt Groups

rest/domain/domain_name/hunts

Parameters

Field Type Description
domain_name String Name of the existing domain.

Success (200 OK)

Example Request:

curl -u admin: GET -D - http://192.168.1.194/rest/domain/localhost/hunts
[ { name: "1002", display: "Hunt", agents: [ 444, 445 ], calls: 0 }, { name: "1003", display: "Hunt_2", agents: [ ], calls: 0 }, { name: "1004", display: "Hunt_3", agents: [ ], calls: 0 } ]

2) Info of a SINGLE Hunt Group

rest/domain/domain_name/user_settings/hunt_group_id

Parameters

Field Type Description
domain_name String Name of the existing domain.
hunt_group_id Int Unique ID (name or number) of the hunt group

Success (200 OK)

Example Request:

curl -u admin: -D - https://192.168.1.194:8080/rest/domain/localhost/user_settings/1002
{ conn_sym: "", connect: "true", display: "Hunt", email: "", flag: "", from_header: "id", hunt_anonymous_dest: "", melody: "ringer6", moh: "", ncf: "false", night: "", rec: "false", st1_dur: "5", st1_ext: "444", st1_miss: "true", st2_dur: "", st2_ext: "445", st2_miss: "true", st3_dur: "", st3_ext: "", st3_miss: "false", st4_ext: "8572665588", acdani: "", ani: "123-456-7899", cdr_time: "", credit: "", dial_plan: "", dialog_state: "", dialog_subscribe: "", dialog_version: "", disabled: "", email_cdr: "", epid: "", location: "", max_call_duration: "", max_cdrs: "", need_license: "", param1: "", param2: "", param3: "", rb: "", rf: "", view_settings: "", visible: "", alias: [ "1002" ] }
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.

POST (Create, Update and Delete the Attributes of the Webpage)

post

Create

/rest/domain/domain_name/addacc

Example Request:

curl -u admin: -D - http://192.168.1.194:8080/rest/domain/localhost/addacc -X POST -d "{ 'type':'hunts', 'account':'1004' }"

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.

Update

/rest/domain/domain_name/user_settings/hunt_group_id

Parameters

Field Type Description
domain_name String Name of the existing domain.
conference_id Int / String Unique ID (number or string) of the Hunt group

Example Request:

curl -u admin: -D - http://192.168.1.194:8080/rest/domain/localhost/user_settings/vodia -X POST -d "{ 'display':'Networks', 'from_header':'id', 'melody':'internal', 'moh':'9', 'st1_ext':'444 445', 'st3_ext':'440', 'st4_ext':'777 8578962323', 'dial_plan':'1', 'connect':'false', 'ncf':'true', 'rec':'true', 'st1_miss':'true', 'st2_miss':'true', 'st3_miss':'false', 'alias':['vodia'] }"

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

Example:

The Hunt Group's account number in the API call below can be obtained using the GET for an entire Hunt Group's list

There are 2 ways of deleting an entry.

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

/rest/domain/domain_name/domain_action

Example:

Request:

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

2) Delete, single account at a time.

/rest/domain/domain_name/addacc/hunt_group_id

Parameters used

Field Type Description
domain_name String Name of the existing domain.
hunt_group_id Int / String Unique ID (String or number) of the Hunt Group to be deleted.

Request:

curl -u admin: -D - http://127.0.0.1:8080/rest/domain/localhost/addacc/1004 -X DELETE

No extra parameters are needed to be specified, to delete a single hunt group.

If multiple hunt group accounts are to be deleted, then the API has to be run multiple timeswith corresponding hunt group IDs.

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.