跳到主要内容

批量分享设备

更新时间:2025-03-04 19:49:45

调用该接口批量分享设备。


描述
路径/platform/user/device/batch/share
版本号1.0.0
协议HTTPS
请求方法POST

请求参数:

公共请求参数见 公共请求参数

请求字段类型必选描述
deviceListList设备列表,一次最多分享20个
iotIdStringproductKey和deviceName为空时,该入参不允许为空。
productKeyString产品的Key,设备证书信息之一。当iotId为空时,该参数不允许为空。
deviceNameString设备的名称,设备证书信息之一。当iotId为空时,该参数不允许为空。
receiverOpenIdString三方用户外标id(receiverOpenId和receiverIdentityId二者必须有其一)。
receiverOpenIdAppKeyString开放平台颁发的appKey。
receiverIdentityIdLong用户身份id(receiverOpenId和receiverIdentityId二者必须有其一)。
permissionListList权限列表,live:直播,control:设备控制,record:录像回看,ptz:云台控制,voiceIntercom:语音对讲,setting:高级设置,notification:消息通知

返回参数:

返回字段类型描述
idString用于识别请求记录,即对应的请求ID。
codeInt接口返回码字段,请求成功时返回200;请求失败时返回详细的错误码。
messageString调用失败时,返回的出错信息。
dataObject响应的结果。
resultListList响应结果列表。
iotIdString设备的iotId。
productKeyString设备的productKey。
deviceNameString设备的deviceName。
errorCodeInt错误码:200:成功,非200:失败, 可参考错误码字典

请求示例:

x-ca-key: xxxxxxxx
x-ca-timestamp: 1728634151000
x-ca-nonce: 7b25fc15b9434dd98587a077a92b7e42
x-ca-signature: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Content-Type: application/json;charset=UTF-8

{
"id": "49a7be925e******8ba0facf7",
"version": "1.0",
"request": {
"apiVer": "1.0.0"
},
"params": {
"deviceList": [
{
"iotId": "5aAE7hj8sald******33092"
}
],
"receiverOpenId": "130****3333",
"receiverOpenIdAppKey": "5Rsd4******ffD",
"permissionList": [
"live",
"record"
]
}
}

成功返回示例:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
"id": "49a7be925e******8ba0facf7",
"code": 200,
"message": "success",
"data": {
"resultList": [
{
"iotId": "5aAE7hj8sald******33092",
"productKey": "5aAE7h******sklajs",
"deviceName": "5s4fas6df******33092",
"errorCode": 200
}
]
}
}