Play a Custom Ringtone
Retrieve the playback resource URL of the specified custom ringtone, then access the URL to download the ringtone and play locally.
Request URL
GET {base_url}/{api_path}/custom_ringtone/play?file={file}&type={type}&access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| file | Yes | String | The filename of the custom ringtone, including the file extension (e.g.,
"demo_ringtone.wav"). Note: You can query the filename of the
custom ringtone using Search Custom Ringtones. |
| type | No | String | The type of the custom ringtone. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| file | String | The filename of the custom ringtone. |
| play_resource_url | String | The playback resource URL of the custom ringtone. |
Example
Request example
GET /openapi/v1.0/custom_ringtone/play?file=Ring1.mp3&type=built-in&access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1
Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"file": "Ring1.mp3",
"play_resource_url": "/api/download/CustomRingtone-3xxxxx7-download-6198d3954d36091e6795ccdb5a966e22.mp3"
}
Combine the playback resource URL with the {base_url}. Then use the complete link to download the ringtone file and play locally.
Play link format
{base_url}/{play_resource_url}
Play link example
https://192.168.5.150:8088/api/download/CustomRingtone-3xxxxx7-download-6198d3954d36091e6795ccdb5a966e22.mp3