audio.ring.add (Add ringtone)
audio.ring.add: Add ringtone
audio.ring.add · Device scope · Permission Config
Feature details
Add a ringtone to the unit. Enter parametersindex,name,url,type, optionalrelateType. Call once and execute once. Theindexof this service is 0 ~ 255; theitem.indexin the audio.ring.config '/ alarmConfig list can be **0 ~ 999999**, which cannot be mixed. Before deleting/adding, it is advisable to compare [get ringtone configuration properties](/book/04-capabilities/audio/ring/config/get.html) with maxCount . The ringtone type field is named: inputData.type for audio.ring.add · [Full update](/book/04-capabilities/audio/ring/updateList-invoke.html) Element soundType · property Configure struct's item.type `(do not mix key names).
Request address
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.service.invoke
Minimum permission
Administrators do not need permission to operate self-bound devices. Basic configuration permission is required to operate the shared device. Child user binding is not required. Sub-account requires Config. A timeout does not imply a failure to execute.
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | String | yes | Administrator, sub-user, or sub-account accessToken |
deviceId | String | yes | Device serial number |
productId | String | no | Optional. If sent and it does not match the device model → DV2009 |
serviceId | String | yes | audio.ring.add |
inputData | Object | yes | See table below |
| Name | Description | Type | Required | Values |
|---|---|---|---|---|
index | Index. Range 0–255, step 1. | int | yes | 0–255, step 1 |
name | Name. | text | yes | string |
url | File URL. Download or file path. | text | yes | string |
type | Ringtone type. | enum | yes | 0 wav; 1 pcm; 2 aac |
relateType | Effective type (optional). | enum | no | 0 device; 1 accessory; 2 reply; 3 local; 4 quickReply; 5 chime |
Common request fields and the signature are in Development specification.
Request example
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1706511734,
"nonce": "f5a1ae2d-c09c-4d39-a744-83a5c2c653c2"
},
"params": {
"token": "<yourAccessToken>",
"deviceId": "TESTIPC000012345",
"serviceId": "audio.ring.add",
"inputData": {
"index": 1,
"name": "ring-1",
"url": "https://example.com/ring.wav",
"type": "0"
}
}
}
# # # Returns a description of the data field
Output is in result.data.outputData. Empty output is {}.
Response example
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {
"outputData": {}
}
}
}
Error Code
Gateway and device error codes are in Global return codes.
