api:pbx:musiconhold:uploadfile
Table of Contents
API : PBX : Music on hold Upload file
Introduction
This request will upload a song to a music on hold playlist.
The following formats are supported:
| Type | Description |
|---|---|
| .wav | Microsoft PCM wave files |
| .mp3 | Mpeg 3 layer 2 audio |
| .m4a | Mpeg 4 audio (mostly used by Apple). |
| .ogg | Ogg-Vorbis. |
| .g722 | 7000Hz Wideband mono audio at 32kHz, 48/56/64kbit/s. (used by PBX's). |
| .alaw | 3500Hz narrowband mono audio at 13bit, 8kHz, 64Kbit/s. (used by PBX's). |
| .ulaw | 3500Hz narrowband mono audio at 13bit, 8kHz, 64Kbit/s. (used by PBX's). |
| .gsm | 3500Hz narrowband mono audio at 13bit, 8kHz, 13Kbit/s. (used by PBX's). |
| .sln16 | Wideband mono audio at 16bit, 16Khz. (used by PBX's). |
Request
| URL | https://api.telecomx.dk/pbx/musiconhold/MOH_ID/audio | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if user belongs to the customer that owns the music on hold class. RESELLER if customer belongs to the reseller. ADMIN. |
||
| Params | MOH_ID | String | Id of the music on hold class to upload the song into. |
| Body | file | Binary | File to upload. |
Request body example
N/A
Response
Metadata about the uploaded audio file.
| JSON object | ||
|---|---|---|
| success | Boolean | True on success. |
Example
{ id: '12345678901234567890ABCD', name: 'My song', length: 120 }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | id | Music on hold not found |
| 404 | file | The file was missing or invalid |
| 422 | file | Invalid audio file |
| 422 | name | Name too short or missing |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/musiconhold/uploadfile.txt · Last modified: 2018/06/29 13:22 by Per Møller