User Tools

Site Tools


api:pbx:audio:upload

API : PBX : Audio Upload

Introduction

This request will upload a new audio file.

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/audio/upload
https://api.telecomx.dk/pbx/audio
Method POST
Access level PERSONAL when audio belongs to the user
MANAGER or OWNER if user belongs to the customer that owns the sound.
RESELLER if customer belongs to the reseller.
ADMIN.
Body file Binary File to upload.
customer Id Id of customer the audio belongs to.
name String [optional] Name of the audio. Defaults to using the filename.
employee Id [optional] Id of employee the audio belongs to and can only be seen/used by.

Request body example

N/A

Response

The new audio item.

Json object
_id Id Unique ID of the audio.
usedBy Array Array of Id's of dialplan items that uses the audio.
name String Human readable name of the audio.
length Number Length of the audio in seconds.
employee Id Optional id of employee the audio belongs to and can only be seen/used by.

Note that properties holding no value may be omitted from the object.

Example

{
  _id: '1234567890123457890ABCD',
  usedBy: ['123457890123457890AAAA','12345678901234567890AAAB'],
  name: 'Welcome greeting 08:00-12:00',
  length: 15,
  employee: null
}

Errors

Error code Message Description
422 file Invalid audio file
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/audio/upload.txt · Last modified: 2025/09/17 11:25 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki