User Tools

Site Tools


api:pbx:playback:list

API : PBX : Playback item list

Introduction

A Playback is a dialplan object that plays back audio files or speaks a composed text that may consist of a mix of texts and variables to be spoken.

Request

This request returns a list of all of the customers playback items.

URL https://api.telecomx.dk/pbx/playback
Method GET
Access level VIEWER, MANAGE, OWNER if playback items belongs to the customer, RESELLER if customer belongs to the 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 1000.
filter [optional] Search query that will match against searchable fields.
full [optional] True to include all settings.
expandGoto [optional] True to expand goto id's into _id/type/number/name objects. Also sets full=true.
customer [optional] Id of customer to show playback items for. Defaults to the users own customer if not specified.
sort [optional] Which property to sort result by: number (default), name, redirect.

Query examples

https://api.telecomx.dk/pbx/playback
https://api.telecomx.dk/pbx/playback?customer=123458789012457890ABCD
https://api.telecomx.dk/pbx/playback?customer=123458789012457890ABCD&limit=20&offset=100
https://api.telecomx.dk/pbx/playback?filter=donald
https://api.telecomx.dk/pbx/playback?customer=12345678901234567890ABCD&full=true
https://api.telecomx.dk/pbx/playback?customer=12345678901234567890ABCD&expandGoto=true

Response

JSON object
offset Index of the first playback item returned.
limit Number of playback item to return. Note that the actual number of returned items may be lower.
total Number of playback items that can be returned when offset and limit is not considered. This is to be used for paging through the data.
playbacks Array of playback items, see definition below.
Playback object (normal)
_id Id Unique id of the playback item.
name String Name/description of the playback item.
number String The phone number to dial to reach this playback item, null if it is not dial-able.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the playback item.
notes String Notes about the playback item.
speak Boolean True if speaking a composed message, false if playing an audio file.
Playback object (full=true)
_id Id Unique id of the playback item.
type String Always 'PLAYBACK'.
name String Name/description of the playback item.
number String The phone number to dial to reach this playback item locally, null if it is not dial-able.
startAudio Id A sound item to playback when the playback item is entered, null if not used.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the playback item.
notes String Notes about the playback item.
speak Object Speak settings
speak.message String The message to perform text-to-speech on, including variables.
speak.engine String [Optional] Which TTS engine to use: ELEVEN_TURBO, ELEVEN_FLASH, ELEVEN_ML, ELEVEN_V3. Defaults to ELEVEN_FLASH.
speak.language String [Optional] Optional language of the message. ISO 639-1 format. If not set, it is inferred from the voice.
speak.voice String The voice to speak with.
speak.speed Number [Optional] Speaking speed, optional, default to 100, range 70-120 (fastest).
speak.stability Number [Optional] Stability, default 50, min 0, max 100.
goto Id The PbxDialplans item to goto when done.

Example - normal

{
  offset: 0,
  limit: 50,
  total: 25,
  playbacks: [
    {
      _id: '12345678901234567890ABCD',
      name: 'VIP Welcome',
      number: '565',
      redirect: null,
      notes: 'Welcome message for VIP customers',
      speak: true
    },
    {
      ...
    }
  ]

Example - full=true

{
  offset: 0,
  limit: 50,
  total: 25,
  playbacks: [
    {
      _id: '12345678901234567890ABCD',
      name: 'VIP Welcome',
      number: '565',
      startAudio: null,
      redirect: null,
      notes: 'Welcome message for VIP customers',
      speak: {
        message: 'Hello <A_NAME>, the time is now <DATE_NOW TIME> and the office is closed. As you are a VIP customer, you are now forward to VIP support. There are current <QUEUE_CALLERS_COUNT 12345678901234567890BBBB> callers in the queue, but we expect to be talking to you in about <QUEUE_CALLERS_MAX_WAIT 12345678901234567890BBBB>.',
        voice: '44561568945161564hgjghi',
        speed: 100,
        engine: 'ELEVEN_V3'
      },
      goto: '1234567890123457890AAAA'
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/playback/list.txt · Last modified: 2025/09/23 12:57 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki