api:pbx:musiconhold:create
Table of Contents
API : PBX : Music on hold Create
Introduction
This request will create a music on hold class.
Request
| URL | https://api.telecomx.dk/pbx/musiconhold | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
||
| Body | customer | Id | [optional] Id of customer the music on hold class should belong to. If not specified the class is a global class available to all customers. Only ADMIN's may create global classes. Default to users own customer if user is not ADMIN. |
| name | String | Name of the class. | |
| random | Boolean | True if music should be played in random order, otherwise it will be played in the list order. | |
Request body example
{ customer: '1234567890ABCDEF12345678', name: 'Music for main queue', random: true }
Response
The response will be the newly created music on hold class, if no errors occurred.
| JSON object | ||
|---|---|---|
| _id | Id | Unique id of the MOH. |
| customer | Id | Id of the customer the MOH belongs to, null if it is a common MOH that can be used by all customers. |
| name | String | Name of the MOH. |
| random | Boolean | True to randomize the songs, false to playback in listed order. |
| Array of audio files (songs) to play. | ||
| audio[].name | String | Filename. |
| audio[].length | Number | Length of song in seconds. |
| audio[].mp3 | Id | GridFS id of the audio file in MP3 format for web/UI playback. |
| audio[].alaw | Id | GridFS id of the audio file in A-LAW format for phone playback. |
| audio[].sln16 | Id | GridFS id of the audio file in SLIN16 format for HD phone playback. |
Example
{ _id: ObjectID('12345678901234567890ABCD'), customer: ObjectID('12345678901234567890ABCD'), name: 'Soft (license free)', random: true, audio: [] }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | customer | Customer is invalid or missing |
| 422 | name | Name too short or missing |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/musiconhold/create.txt · Last modified: 2025/06/04 10:45 by Per Møller