device.capability.list(查询可用能力)
device.capability.list:查询可用能力
功能详情
查询可用能力,含取值说明。按设备查须已绑定(未绑定 DV2013);按型号查只验 token。本接口不按权限裁清单。
请求地址
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.capability.list
最小权限
按设备查须设备已绑定到当前账号、或为分享/子账号授权可见设备;返回清单不按能力分享码裁剪。按型号查只验 token。子账号权限见 device.capability.list 说明节。
传入参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 合法值 | 参数说明 |
|---|---|---|---|---|---|
token | String | 是 | 管理员、子用户或子账号 accessToken | ||
deviceId | String | 条件 | 按设备查时传。与 productId 至少传一个 | ||
productId | String | 条件 | 按型号查时传。与 deviceId 至少传一个 | ||
channelId | String | 否 | 通道号,IPC 常见 "0"。不要传 -1 | 只在按设备查时有意义。不传 = 查设备级。传 = 该通道通道级 外加 设备级 | |
lang | String | 否 | 应用站点默认 | 如 zh-CN | 展示文案语言 |
incloudTsl | Boolean | 否 | false | true / false | 为 true 时返回各叶子项 tsl(ident/ref) |
都传 deviceId 与 productId 时以设备为准;型号不一致返回 DV2009。字段与 device.capability.list 一致。
样例输入
{
"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",
"channelId": "0"
}
}
返回 data 字段说明
| 参数名 | 参数类型 | 参数说明 |
|---|---|---|
deviceId | String | 回显。按型号查时不返回 |
channelId | String | 回显;未传则不返回 |
productId | String | 型号。按设备查时由平台解析回显 |
bindType | String | 型号绑定类型 |
capabilities | Array | 可用能力清单 |
capabilities[].capabilityId | String | 一组能力的 id。仅作响应字段,不要拿去发 get / set / invoke / 查告警;请用下面的整段 propertyId / serviceId / eventId |
capabilities[].name | String | 展示名 |
capabilities[].scope | String | device 设备 / channel 通道 / all 两者都有 |
capabilities[].properties | Array | 配置 / 状态项;无则为 [] |
capabilities[].properties[].propertyId | String | 整段 propertyId |
capabilities[].properties[].name | String | 展示名 |
capabilities[].properties[].desc | String | 说明。空则不返回 |
capabilities[].properties[].accessMode | String | r 只读 / w 只写 / rw 可读写。含 w 才允许 set |
capabilities[].properties[].defaultData | 同点位 | 默认值。无则不返回。开关为 int 0/1 |
capabilities[].properties[].dataType | Object | 取值说明 |
capabilities[].properties[].dataType.type | String | int / float / enum / text / struct / array。公开不出现 bool |
capabilities[].properties[].dataType.specs.range | Array | [下限, 上限],仅数值类型 |
capabilities[].properties[].dataType.specs.list | Array | 枚举项。每项含 value 与 desc |
capabilities[].services | Array | 一次性动作;无则为 [] |
capabilities[].services[].serviceId | String | 整段 serviceId |
capabilities[].services[].name | String | 展示名 |
capabilities[].services[].inputData | Array | 入参。field 为调用 key。无入参为 [] |
capabilities[].services[].outputData | Array | 出参。无出参为 [] |
capabilities[].services[].timeoutMs | Int | 建议超时 |
capabilities[].events | Array | 上报事件;无则为 [] |
capabilities[].events[].eventId | String | 整段 eventId;查询报文里的 msgType 即此值 |
capabilities[].events[].name | String | 展示名 |
capabilities[].events[].outputData | Array | 事件字段。没有则为 [] |
struct 子项 key 为 field。某型号实际档位可能是目录子集。
样例输出
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {
"deviceId": "TESTIPC000012345",
"channelId": "0",
"productId": "56WGTET2",
"bindType": "paas",
"capabilities": [
{
"capabilityId": "detection.motion",
"name": "动检",
"scope": "channel",
"properties": [
{
"propertyId": "detection.motion.enabled",
"name": "移动检测",
"accessMode": "rw",
"defaultData": 0,
"dataType": {
"type": "int",
"specs": {
"range": [0, 1]
}
}
},
{
"propertyId": "detection.motion.sensitivity",
"name": "灵敏度",
"accessMode": "rw",
"dataType": {
"type": "enum",
"specs": {
"list": [
{ "value": "1", "desc": "低" },
{ "value": "3", "desc": "中" },
{ "value": "5", "desc": "高" }
]
}
}
}
],
"services": [],
"events": [
{
"eventId": "detection.motion.detected",
"name": "移动检测报警",
"outputData": []
}
]
},
{
"capabilityId": "ptz.aim",
"name": "云台瞄准",
"scope": "channel",
"properties": [],
"services": [
{
"serviceId": "ptz.aim.relative",
"name": "按速度转动",
"inputData": [
{
"field": "horizontal",
"name": "水平速度",
"dataType": { "type": "text" }
},
{
"field": "vertical",
"name": "垂直速度",
"dataType": { "type": "text" }
},
{
"field": "zoom",
"name": "变倍",
"dataType": { "type": "text" }
},
{
"field": "duration",
"name": "持续时间",
"dataType": { "type": "int" }
}
],
"outputData": [],
"timeoutMs": 10000
}
],
"events": []
}
]
}
}
}
错误码
本接口可能返回下列码。
网关
DV20xx
