Play a Prompt

Play audio prompt to an extension user, an external user or a Paging group.

Request URL

{base_url}/{api_path}/call/playprompt?token={token}

Request parameters

Parameter Required Type Description
number Yes String The target number that will receive the prompt.
Valid values:
  • Extension number
  • External number
  • Paging Group number
prompt Yes String The name of audio file that will be played.

Valid values:

  • For an audio file: Enter the filename.

    Example: music1.

  • For multiple audio files: Separate the filenames with + .

    Example: music1+music2.

Note:
  • The audio file must be uploaded to the PBX's Custom Prompt page beforehand.
  • The file name must contain at least a letter, and cannot contain character +.
count No Integer The frequency of playing audio files.
dialpermission No String If number is an external number, dialpermission must be the extension which is of outbound call permission.
autoanswer No String If caller is an extension number, you can decide whether to auto answer the call to callee.
Note: This feature requires the SIP phone to support.
Valid values:
  • yes
  • no

Default value: no

volume No Integer The volume will be played.

Valid value: 0~20

Response parameters

Parameter Type Description
status String Request result.
  • Success
  • Failed
callid String The unique ID of each call.

Example

Request example

POST /api/v2.0.0/call/playprompt?token=16cfa49e417009cf1017aa284217f3ff HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150

{
	"number": "1023",
	"prompt": "music1+music2",
	"count": "2",
	"autoanswer": "yes",
	"volume": "10"
}
Response example
HTTP/1.1 200 OK
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close
Content-Type: application/json
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE

{
	"status": "Success",
	"callid": "1571714617.6"
}