Table of Contents

API : PBX : Voicemail box list

Introduction

A voicemail box item sends the caller to the voicemail box of an employee - either to leave a message, or to listen to the messages and configure the voicemail.

The voicemail box belongs to the employee currently on the selected extension, so it follows hotdesking. When listening, the caller can instead be asked to enter the extension number (askForExtension), which makes the item a number the employees can call from any phone to reach their voicemail. If no extension is selected, or the extension has no employee, the caller is told that voicemail is not enabled.

Listening always requires the employee's pincode - also when the employee calls from their own phone. If the call variable pin holds the correct pincode, for example set with a Set value item or by a URL router earlier in the call, the caller is let straight in. Otherwise the caller is asked to enter it. A wrong pin counts as a wrong pincode, and after 5 wrong pincodes the voicemail box is locked for 15 minutes. The value of the call variable pin is never shown in realtime events or API responses - it is shown as ****.

Request

This request returns a list of all of the customers voicemail box items.

URL https://api.telecomx.dk/pbx/voicemailbox
Method GET
Access level VIEWER, MANAGE, OWNER if voicemail box items belongs to the customer, RESELLER if customer belongs to the reseller, RESELLER_ADMIN 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.
expandGoto [optional] True to expand the extension id into an _id/type/number/name object.
customer [optional] Id of customer to show voicemail box 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/voicemailbox
https://api.telecomx.dk/pbx/voicemailbox?customer=123458789012457890ABCD
https://api.telecomx.dk/pbx/voicemailbox?customer=123458789012457890ABCD&limit=20&offset=100
https://api.telecomx.dk/pbx/voicemailbox?filter=aflyt
https://api.telecomx.dk/pbx/voicemailbox?customer=12345678901234567890ABCD&expandGoto=true

Response

JSON object
Property Type Description
offset Number Index of the first voicemail box item returned.
limit Number Number of voicemail box items to return. Note that the actual number of returned items may be lower.
total Number Number of voicemail box items that can be returned when offset and limit is not considered. This is to be used for paging through the data.
voicemailBoxes Array List of voicemail box items, see definition below.
Voicemail box object
Property Type Description
_id Id Unique id of the voicemail box.
type String Always 'VOICEMAIL_BOX'.
customer Id Id of the customer the voicemail box belongs to.
name String Name/description of the voicemail box.
number String The phone number to dial to reach this voicemail box locally, null if it is not dial-able.
startAudio Id A PBX audio item to playback when the voicemail box is entered. Null if not used.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the voicemail box item.
notes String Notes about the voicemail box item.
mode String What the caller is sent to the voicemail box for: RECORD - leave a message (default). LISTEN - listen to messages and configure the voicemail, pincode protected.
extension Id Extension dialplan item whose employee owns the voicemail box. Null when askForExtension is true. Set to null automatically if the extension is deleted.
askForExtension Boolean LISTEN only: true to ask the caller for the extension number instead of using extension. Always false for RECORD.
x Number X position in visual dialplan.
y Number Y position in visual dialplan.

Example

{
  offset: 0,
  limit: 50,
  total: 2,
  voicemailBoxes: [
    {
      _id: '12345678901234567890FEED',
      type: 'VOICEMAIL_BOX',
      customer: '12345678901234567890ABCD',
      name: 'Aflyt telefonsvarer',
      number: '8888',
      startAudio: null,
      redirect: '',
      notes: '',
      mode: 'LISTEN',
      extension: null,
      askForExtension: true,
      x: 123,
      y: 456
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>