Vodia PBX API (version 58.0 and above)

This page includes all the API parameters of the page Domain level Music on hold sources (MOH) Settings.

Music On Hold Setting(s)

GET Moh Setting(s)

GET

1) Info of Music on Hold page from the Domain > Feature > Music On Hold

/rest/domain/domain_name/moh

Parameters

Field Type Description
domain_name String Name of the existing domain.

Success (200 OK)

Example:

Request:

curl -u username:password GET -D - https://localhost:8080/rest/domain/localhost/moh
{ 9: { name: "MOH1", file: "audio_upload/moh-9.wav", volume: "", type: "file", domain: "1" }, 10: { name: "moh", file: "audio_upload/moh-10.wav", volume: "", type: "file", domain: "1" }, 19: { name: "fff", file: "audio_upload/moh-19.wav", volume: "", type: "file", domain: "1" }, 24: { name: "uuu", file: "audio_upload/moh-24.wav", volume: "100", type: "file", domain: "1" }, 25: { name: "Sachin", file: "audio_upload/moh-25.wav", volume: "100", type: "file", domain: "" }, 26: { name: "kjkjk", file: ":l16b", volume: "100", type: "wavein", domain: "1" }, maxsize: 16777216 }
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 Moh Source's page

post
/rest/domain/domain_name/moh

Parameters

Field Type Description
domain_name String Name of the existing domain.

Example:

Request:

curl -u username:password -D - https://localhost:8080/rest/domain/localhost/moh -X POST -d "{ 'name':'Dom_moh', 'type':'wavein', 'volume':'100', 'file':':l16b' }"

DELETE Moh Source's page

post
/rest/domain/domain_name/moh/moh_id

Parameters used

Field Type Description
domain_name String Name of the existing domain.
moh_id Int Moh ID number (that can be gotten from GET request above) to be deleted

Example:

Request:

curl -u admin: -D - https://localhost:8080/rest/domain/localhost/moh/26 -X DELETE -d

If multiple Mohs are to be deleted at once, then the same API command can be run multiple times.

Response for the Update and delete requests:

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.