2.36、自定义告警声音

在设备已开启人形侦测或移动侦测的前提下,自定义告警声音

POSThttps://open.eye4cloud.com/{{open_id}}/open/v1/device/customAlarmSound
请求数据
字段名 是否必传 类型 备注
device_id 是 string 设备id
timestamp 是 int64 时间戳,单位:秒
nonce 是 string 随机字符串,8~20个字符
sign 是 string 具体实现方法,请参考《生成sign的示例代码》
password 否 string 设备密码,如果不传则使用开放平台中注册设备的密码
data 否 string 设备DATA,可传空字符串
imei 否 string 设备IMEI,可传空字符串
voiceType 是 int 自定义提示音类型(侦测类型:根据运动侦测类型传参,侦测类型对不上则不会生效):1=人形侦测,3=移动侦测
switch 是 int 自定义提示音开关:0=关闭,1=开启
PlayTimes 是 int 播放次数
urlJson 是 string 下载地址
filename 是 string 文件名
play 是 int 试听:0=不播放,1=播放
CURL请求示例
CURL
curl 'https://open.eye4cloud.com/{{open_id}}/open/v1/device/customAlarmSound' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "device_id": "xxxx",
    "timestamp": 1758867195,
    "nonce": "",
    "sign": "",
    "password": "",
    "voiceType":1,
    "switch":1,
    "PlayTimes":1,
    "urlJson":"{"url":"https://example.com/DEMO_RESOURCE"}",
    "filename":"您已进入监控区域",
    "play":1
}'
返回数据
字段名 类型 备注
error_code int 状态码:0正常,其他异常
error_message string 错误信息:正常为success
data object {}
data.resp int 响应结果:1=执行成功,2=执行失败

示例:

JSON
{
    "error_code": 0,
    "error_message": "success",
    "error_tips": "",
    "data": {
            "resp": 1
    }
}