User Tools

Site Tools


api:pbx:audio:list

API : PBX : Audio list

Introduction

Audio can be played back to a caller. An audio item consists of metadata (name, length, owner) and a link to the audio on the audio servers.

This request will return the list of audio items that belongs to a customer.

Request

URL https://api.telecomx.dk/pbx/audio
Method GET
Access level PERSONAL if audio belongs to the user
VIEWER, MANAGE, OWNER, RESELLER or ADMIN.
Query offset [optional] Index of the first item to return, default 0.
limit [optional] The number of items to return, default 50, min 1, max 100.
filter [optional] Search query that will match against the name of the audio.
customer [optional] Id of customer to show audios for. Defaults to the users own customer if not specified.
links [optional] True to add playback links to each item for all the available audio versions.
employee [optional] Id of employee the audio belongs to and can only be seen/used by.

Query examples

https://api.telecomx.dk/pbx/audio
https://api.telecomx.dk/pbx/audio?customer=123458789012457890ABCD
https://api.telecomx.dk/pbx/audio?filter=Welcome%30message
https://api.telecomx.dk/pbx/audio?links=true
https://api.telecomx.dk/pbx/audio?employee=12345678901234567890AAAA

Response

JSON object
offset Index of the first audio returned.
limit Number of audios to return. Note that the actual number of returned items may be lower.
total Number of audios that can be returned when offset and limit is not considered. This is to be used for paging through the data.
audios Array of audios, see definition below.
Sound 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 used/seen by.

Example

{
  offset: 0,
  limit: 50,
  total: 25,
  audios: [
    {
      _id: '1234567890123457890ABCD',
      usedBy: ['123457890123457890AAAA','12345678901234567890AAAB'],
      name: 'Welcome greeting 08:00-12:00',
      length: 15,
      employee: null
    },
    {
      ...
    }
  ]
{
  offset: 0,
  limit: 50,
  total: 25,
  audios: [
    {
      _id: '1234567890123457890ABCD',
      usedBy: ['123457890123457890AAAA','12345678901234567890AAAB'],
      name: 'Welcome greeting 08:00-12:00',
      length: 15,
      employee: null,
      mp3: 'https://audio.telecomx.dk/12345678901234567890ABCD.mp3?token=789789789456456123121564',
      wav: 'https://audio.telecomx.dk/12345678901234567890ABCD.wav?token=789789789456456123121564',
      alaw: 'https://audio.telecomx.dk/12345678901234567890ABCD.alaw?token=789789789456456123121564',
      ulaw: 'https://audio.telecomx.dk/12345678901234567890ABCD?.ulawtoken=789789789456456123121564',
      gsm: 'https://audio.telecomx.dk/12345678901234567890ABCD.gsm?token=789789789456456123121564',
      m4a: 'https://audio.telecomx.dk/12345678901234567890ABCD,m4a?token=789789789456456123121564',
      sln16: 'https://audio.telecomx.dk/12345678901234567890ABCD.sln16?token=789789789456456123121564',
      highmp3: 'https://audio.telecomx.dk/12345678901234567890ABCD.high.mp3?token=789789789456456123121564',
      lowmp3: 'https://audio.telecomx.dk/12345678901234567890ABCD.low.mp3?token=789789789456456123121564',
      g722: 'https://audio.telecomx.dk/12345678901234567890ABCD.g722?token=789789789456456123121564'
    },
    {
      ...
    }
  ]

Playback of audio files

Audio files can be played back by composing a url like this:

https://audio.telecomx.dk/<AUDIO-ID><SUFFIX>?token=<TOKEN>
https://audio.telecomx.dk/<AUDIO-ID>/<FILENAME><SUFFIX>?token=<TOKEN>
Property Description
AUDIO-ID Id of the audio item (_id).
SUFFIX Format to get the file in - see list below.
FILENAME To enforce download instead of browser playback, supply a filename.
TOKEN Current users token see login page.
Suffix Description
alaw 64Kbit 8KHz A-Law raw mono
ulaw 64Kbit 8KHz Mu-LAw raw mono
mp3 128Kbit MP3 mono/stereo
wav 8-256Kbit Microsoft wave mono/stereo
gsm 13Kbit 8KHz GSM mono
m4a 128Kbit Apple AAC in m4a container mono/stereo
sln16 16Kbit wideband signed linear mono
high.mp3 256Kbit MP3 mono/stereo
low.mp3 8Kbit MP3 mono
g722 16Kbit wideband mono

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/audio/list.txt · Last modified: 2019/06/26 12:02 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki