Add an MoH Playlist

Add an MoH (music on hold) playlist.

Request URL

POST {base_url}/{api_path}/play_list/create?access_token={access_token}

Request parameters

Parameter Required Type Description
list_name Yes String The name of the MoH playlist.
list_type Yes Integer The type of the MoH playlist.

Valid value:

  • 1: Local audio.
  • 2: Streaming music.
play_order No String Playback order of the MoH in the playlist.

Valid value:

  • random: Randomly.
  • alphabetical: Alphabetically.
Note: This parameter is required when list_type is set to 1.
stream_url No String The URL of the streaming music.
Note: This parameter is required when list_type is set to 2.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
id Integer The unique ID of the MoH playlist.

Examples

Request example

POST /openapi/v1.0/play_list/create?access_token=vtkE9as9ILt8D7zd20beBzd8dL2uTcOL HTTP/1.1  
Host: 192.168.5.150:8088
Content-Type: application/json
{
    "list_name": "Professional",
    "list_type": 1,
    "play_order": "random"
}

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "id": 16
}