Table of Contents

API : PBX : Music on hold Update

Introduction

This request will update a music on hold class.

When updating, you do not need to send the full object. As little as a single property can be sent, so only send the properties you need to update, and the rest will be untouched.

Request

URL https://api.telecomx.dk/pbx/musiconhold/MOH_ID
Method POST
Access level MANAGER or OWNER if user belongs to the customer that owns it.
RESELLER if customer belongs to the reseller.
ADMIN.
params MOH_ID Id Id of the music on hold class to update.
Body name String Name of the class.
random Boolean True if music should be played in random order, otherwise it will be played in the list order.

Request body example

{
  name: 'Music for callcenter',
}

Response

The response will be the updated created music on hold class, if no errors occurred.

JSON object
_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

{
  _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
404 id Music on hold not found
422 name Name too short or missing
403 access_denied Insufficient access level
500 internal_error <Unspecified>