业务消息
业务消息
绑定、解绑、分享、授权变更与托管。不是控制台勾选,也不是能力消息外壳(不是 deviceId / outputData)。
须已配置回调地址;不要求订 capabilityEvent / deviceStatus / faceAnalysis。样例为未开回调鉴权时的 POST 体。开启鉴权时外层与其它推送相同(system + params),见 签名。
托管流程见 接收终端用户托管的设备。
类型
| 说明 | msgType |
|---|---|
| 绑定设备 | bindDevice |
| 解绑设备 | unbindDevice |
| 设备分享 | deviceShare |
| 授权数据变更 | deviceAuthorizationChanged |
| 取消分享 | deviceShareCancel |
| 分享关系清除 | deviceDeletedSharedCancel |
| 托管完成 | warrantInit |
| 取消托管 | deviceAuthCancel |
| 修改托管权限 | warrantModify |
| 托管关系清除 | authorityRemove |
绑定设备
设备绑定到账号后推送。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 bindDevice |
type | String | 61 |
time | Int | 事件时间,Unix 秒 |
msgDeviceId | String | 设备序列号 |
productId | String | 产品 ID;非物模型设备可能为 normal |
appId | String | 开发者应用 ID |
{
"msgType": "bindDevice",
"type": "61",
"time": 1731200000,
"msgDeviceId": "TESTQWERXXXX",
"productId": "normal",
"appId": "lcdxxxxxxxxx"
}
解绑设备
设备从账号解绑后推送。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 unbindDevice |
type | String | 62 |
time | Int | 事件时间,Unix 秒 |
msgDeviceId | String | 设备序列号 |
productId | String | 产品 ID;非物模型设备可能为 normal |
appId | String | 开发者应用 ID |
{
"msgType": "unbindDevice",
"type": "62",
"time": 1731200000,
"msgDeviceId": "TESTQWERXXXX",
"productId": "normal",
"appId": "lcdxxxxxxxxx"
}
设备分享
设备分享成功后推送。与「授权数据变更」是两条独立消息。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 deviceShare |
type | String | 70 |
time | Int | 事件时间,Unix 秒 |
msgDeviceId | String | 设备序列号 |
msgChannelId | String | 通道 ID;无通道时可空 |
msgDeviceName | String | 设备名称 |
msgOwnerId | String | 设备所有者用户 ID |
appId | String | 开发者应用 ID |
{
"msgType": "deviceShare",
"type": "70",
"time": 1731200000,
"msgDeviceId": "TESTQWERXXXX",
"msgChannelId": "0",
"msgDeviceName": "客厅摄像机",
"msgOwnerId": "1000001",
"appId": "lcdxxxxxxxxx"
}
授权数据变更
分享成功时还会收到本条。取消分享时还会再推。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 deviceAuthorizationChanged |
type | String | 78 |
time | Int | 事件时间,Unix 秒 |
msgChannelList | Array | 设备与通道列表 |
msgChannelList[].deviceId | String | 设备序列号 |
msgChannelList[].channelId | String | 通道 ID |
appId | String | 开发者应用 ID |
{
"msgType": "deviceAuthorizationChanged",
"type": "78",
"time": 1731200000,
"msgChannelList": [
{ "deviceId": "TESTQWERXXXX", "channelId": "0" }
],
"appId": "lcdxxxxxxxxx"
}
取消分享
分享取消后推送。同一次取消分享通常还会收到 deviceDeletedSharedCancel 与 deviceAuthorizationChanged,字段见下文。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 deviceShareCancel |
type | String | 76 |
time | Int | 事件时间,Unix 秒 |
msgDeviceId | String | 设备序列号 |
msgChannelId | String | 通道 ID |
msgDeviceName | String | 设备名称;部分场景出现 |
msgOwnerId | String | 设备所有者用户 ID;部分场景出现 |
appId | String | 开发者应用 ID |
{
"msgType": "deviceShareCancel",
"type": "76",
"time": 1731200000,
"msgDeviceId": "TESTQWERXXXX",
"msgChannelId": "0",
"appId": "lcdxxxxxxxxx"
}
分享关系清除
取消分享、设备删除、解绑或转移导致分享失效时,通知相关方。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 deviceDeletedSharedCancel |
type | String | 75 |
time | Int | 事件时间,Unix 秒 |
msgDeviceIds | String | 设备序列号列表的 JSON 文本 |
appId | String | 开发者应用 ID |
{
"msgType": "deviceDeletedSharedCancel",
"type": "75",
"time": 1731200000,
"msgDeviceIds": "[\"TESTQWERXXXX\"]",
"appId": "lcdxxxxxxxxx"
}
托管完成
终端用户完成托管后推送。托管链接带了 state 则原样返回。流程见 接收终端用户托管的设备。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 warrantInit |
warrantId | String | 托管单 ID |
phone | String | 终端用户手机号(脱敏) |
remark | String | 备注 |
state | String | 链接上的业务参数;未带则不出现 |
deviceList | Array | 已授权设备 |
deviceList[].deviceId | String | 设备序列号 |
deviceList[].deviceName | String | 设备名称 |
deviceList[].productId | String | 产品 ID |
deviceList[].authority | String | 已授权权限,逗号分隔 |
deviceList[].channelId | String | 通道 ID;有通道时出现 |
deviceList[].channelName | String | 通道名称;有通道时出现 |
appId | String | 开发者应用 ID |
{
"msgType": "warrantInit",
"warrantId": "146746972164984832",
"phone": "158***404",
"remark": "",
"state": "qwetyewoewewyriuweyriwhd",
"deviceList": [
{
"deviceId": "TESTQWERXXXX",
"deviceName": "TP1S-2113",
"productId": "56WGTET2",
"authority": "RecordReplay,Format",
"channelId": "0",
"channelName": "TP1S-2113"
}
],
"appId": "lcdxxxxxxxxx"
}
取消托管
开发者拒绝或终端用户取消托管后推送。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 deviceAuthCancel |
deviceList | Array | 取消托管的设备 |
deviceList[].deviceId | String | 设备序列号 |
deviceList[].channelId | String | 通道 ID;普通设备项出现 |
deviceList[].productId | String | 产品 ID;物模型设备项出现 |
appId | String | 开发者应用 ID |
{
"msgType": "deviceAuthCancel",
"deviceList": [
{ "deviceId": "TESTQWERXXXX", "channelId": "0" },
{ "deviceId": "IOTXXXX", "productId": "ABC123" }
],
"appId": "lcdxxxxxxxxx"
}
修改托管权限
托管权限变更后推送,带该单下仍有权限的设备。无 state。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 warrantModify |
warrantId | String | 托管单 ID |
phone | String | 终端用户手机号(脱敏) |
remark | String | 备注 |
deviceList | Array | 该单下仍有权限的设备 |
deviceList[].deviceId | String | 设备序列号 |
deviceList[].deviceName | String | 设备名称 |
deviceList[].productId | String | 产品 ID |
deviceList[].authority | String | 已授权权限,逗号分隔 |
deviceList[].channelId | String | 通道 ID;有通道时出现 |
deviceList[].channelName | String | 通道名称;有通道时出现 |
appId | String | 开发者应用 ID |
{
"msgType": "warrantModify",
"warrantId": "146109321904787456",
"phone": "18***096",
"remark": "",
"deviceList": [
{
"deviceId": "TESTQWERXXXX",
"deviceName": "TP1S-4574",
"productId": "56WGTET2",
"authority": "Format,Config,Siren",
"channelId": "0",
"channelName": "TP1S-4574"
}
],
"appId": "lcdxxxxxxxxx"
}
托管关系清除
设备解绑、转移或分享导致原托管失效时推送。
| 字段 | 类型 | 说明 |
|---|---|---|
msgType | String | 固定 authorityRemove |
warrantId | String | 托管单 ID |
deviceId | String | 设备序列号 |
productId | String | 产品 ID;物模型设备出现 |
operation | String | unbindDevice 解绑;transferDeviceFrom 转移;unShareDevice 取消分享;shareDevice 分享 |
appId | String | 开发者应用 ID |
{
"msgType": "authorityRemove",
"warrantId": "146690789022502912",
"deviceId": "TESTQWERXXXX",
"operation": "unbindDevice",
"appId": "lcdxxxxxxxxx"
}