Vodia PBX API (version 58.0 and above)

Service Flags

GET (Getting the list of all Service Flags)

GET

1) Info of the entire list of Service Flags.

rest/domain/domain_name/srvflags

Parameters

Field Type Description
domain_name String Name of the existing domain.

Success (200 OK)

Example Request:

curl -u username:password GET -D - https://192.168.1.194:8080/rest/domain/vodia/srvflags
[ { name: "222", display: "", mode: "manual", state: false }, { name: "333", display: "", mode: "clock", state: true }, { name: "111", display: "", mode: "manual", state: true }, { name: "666", display: "tyu", mode: "", state: false } ]

2) Info of a SINGLE service flag

rest/domain/domain_name/user_settings/service_flag_account_number

Parameters

Field Type Description
domain_name String Name of the existing domain.
service_flag_account_number Int Service Flag account number

Success (200 OK)

Example Request:

curl -u username:password -D - https://127.0.0.1/rest/domain/vodia/user_settings/111
{ allow_ext: "440", display: "", fri: "", hol: "", holiday: "", invert: "false", last: "true", mode: "manual", mon: "00:00-8:AM 20:30-9:AM", pin: "pass", sat: "", sound: "service", state: "true", sun: "", thu: "20:30-8:AM", today: "", tue: "", tz: "", wed: "10:07-11:AM", acdani: "", acturl_call: "", acturl_cleardnd: "", acturl_clearwakeup: "", acturl_connect: "", acturl_dnd: "", acturl_emergency: "", acturl_mailbox: "", acturl_missedwakeup: "", acturl_newcall: "", acturl_roomcleaned: "", acturl_wakeupcall: "", ani: "", anonymous_spam_score: "", 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: "", spam_threshold: "", view_settings: "", visible: "", alias: [ "111" ] }
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.

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

post

Create

/rest/domain/domain_name/addacc

Example Request:

curl -u username:password -D - http://127.0.0.1/rest/domain/vodia/addacc -X POST -d "{'type':'srvflags','account':'555'}"

Update

/rest/domain/domain_name/user_settings/service_flag_account_number

Example Request:

curl -u username:password -D - http://127.0.0.1/rest/domain/vodia/user_settings/555 -X POST -d "{'allow_ex': '444 446 447', 'display': 'Sachin_2', 'fri': '', 'hol':'', 'holiday': '', 'invert':'false'}" }"

Delete

/rest/domain/domain_name/addacc/service_flag_account_number (Single or Multiple service flag account number deletion)
Example Request:

The domain name in the API call below can be obtained using the GET for entire domains list

If multiple service flag account have to be deleted at once, multiple API calls have to be sent, with varying domain names.

Request (for deleting single service flag account):

curl -u username:password -D - http://127.0.0.1/rest/domain/vodia/addacc/555 -X DELETE

Response for Create, Update and Delete requests:

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.