Play Prompt to Extension

Play a prompt to an extension user.

The work flow is as follows:
  1. The PBX system dials a specific extension number.
  2. The extension rings and the call gets picked up.
  3. The music will be played automatically.

Endpoint

POST /api/v1.1.0/extension/playprompt?token={token}

Request Parameters

Name Importance Type Description
extid Required Int The extension number.
prompt Required String Audio file name.
Note:
  • The file name must contain at least a letter, and cannot contain character +.
  • The audio file must be uploaded to the PBX's Custom Prompt page beforehand.

For multiple audio files, separate the file names with + .

Example: "prompt:music1+music2"

autoanswer Optional String Whether the extension will auto answer or not.
  • Yes
  • No
Note: This parameter requires the SIP phone to support.

Response Parameters

Name Type Description
callid String An unique identifier for the call.

Examples

Request Example

Play one prompt:

POST /api/v1.1.0/extension/playprompt?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: api.yeastarcloud.com
{
    "extid": "1000",
    "prompt": "hello111",
    "autoanswer": "no"
}

Play a prompt list:

POST /api/v1.1.0/extension/playprompt?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: api.yeastarcloud.com
{
    "extid": "1000",
    "prompt": "1+queue1+queue2",
    "autoanswer": "no"
}
Response Example
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
    "status": "Success",
    "callid": "1495697869.171"
}