User Tools

Site Tools


api:pbx:musiconhold:list

API : PBX : Music on hold list

Introduction

This request will return the list of music on hold classes available to a customers hosted PBX.

There are private classes which can only be used by a single customer, and there are public classes which may be used by all customers, but only edited by ADMIN's.

Request

URL https://api.telecomx.dk/pbx/musiconhold
Method GET
Access level VIEWER, MANAGE, OWNER, RESELLER or ADMIN
Query customer [optional] Customer to lookup music on hold classes for. Defaults to the users own customer.
full [optional] True to include songs with name, length and file id's.
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 name.

Query examples

https://api.telecomx.dk/pbx/musiconhold
https://api.telecomx.dk/pbx/musiconhold?customer=1234567890ABCDEF12345678
https://api.telecomx.dk/pbx/musiconhold?offset=10&limit=25
https://api.telecomx.dk/pbx/musiconhold?filter=free

Response

JSON object
offset Number Index of the first music on hold item returned.
limit Number Number of music on hold items to return. Note that the actual number of returned items may be lower.
total Number Number of music on hold items that can be returned when offset and limit is not considered. This is to be used for paging through the data.
musicOnHold Array Array of music on hold items, see definition below.
Music on hold object (normal)
_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.
audio Number Number of songs in the playlist.
Music on hold object (if full=true)
_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[].id Id Id of the song.
audio[].name String Name of the song.
audio[].length Number Length of song in seconds.

Example

{
  offset: 0,
  limit: 50,
  total: 120,
  musicOnHold: [
    {
      _id: ObjectID('12345678901234567890ABCD'),
      customer: ObjectID('12345678901234567890ABCD'),
      name: 'Soft (license free)',
      random: true,
      audio: [
        {
          id: '123456789012345678900001',
          name: 'Smooth sailing',
          length: 362
        },
        {
          id: '123456789012345678900001',
          name: 'By the riverside',
          length: 362
        }
      ]
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/musiconhold/list.txt · Last modified: 2018/09/16 10:02 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki