device.message.detail(查询单条告警)
device.message.detail:查询单条告警
功能详情
按 alarmId 查询单条。无权整单 DV2011。返回的是一条上报报文(与 接收告警 相同),不是 list 的 count / nextAlarmId。msgType 等于 eventId。
历史 alarm / deviceStatus 报文外壳不同,见 接收设备消息。
平台字段(token、thumbUrl、picUrlArray、labelType、智见相关)不在能力项的 outputData 里。
请求地址
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.message.detail
最小权限
管理员操作自己绑定的设备不需要权限。操作被分享设备需要报警消息权限。子用户绑定不需要。子账号按条校验该条事件所属能力的 share/sub 权限码(见 权限码)。设备须已绑定。
传入参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 合法值 | 参数说明 |
|---|---|---|---|---|---|
token | String | 是 | 管理员、子用户或子账号 accessToken | ||
deviceId | String | 是 | 设备序列号 | ||
productId | String | 否 | 可省略。传了且与该设备实际型号不一致 → DV2009 | ||
alarmId | String | 是 | 告警 id |
样例输入
{
"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",
"alarmId": "116257862023505xxxx"
}
}
返回 data 字段说明
data 即为单条告警对象。
| 参数名 | 参数类型 | 参数说明 |
|---|---|---|
msgType | String | 等于 eventId,如 detection.motion.detected |
deviceId | String | 设备序列号 |
productId | String | 型号 |
channelId | String | 通道级事件返回;设备级不返回 |
outputData | Object | 该事件的字段。没有则为 {} |
time | Int | 上报时间,Unix 秒 |
localTime | String | 设备本地 yyyyMMddTHHmmss |
alarmId | String | 告警 id |
token | String | 联动云录像时出现 |
thumbUrl | String | 缩略图。有图才返回 |
picUrlArray | Array | 告警图。有时效,尽快转存 |
labelType | String | 消息类型标签 |
aiCopyWriting | String | 开通智见云存储或 AI 智见套餐时才有 |
securityRiskLevel | String | 开通智见才有;list/search/detail 经 Mix 归一化时常为等级文案(如 high),非推送样例中的 1~10 整数 |
aiTag | String | 开通智见才有;Mix 归一化常为单标签字符串(如 human),非数组 |
feedback | Object | list / search / detail 可返回;实时推送(g04)无。type:1 人形、2 人脸、3 大模型;result:0 不准确 / 1 准确 |
样例输出
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {
"msgType": "detection.motion.detected",
"deviceId": "TESTIPC000012345",
"productId": "56WGTET2",
"channelId": "0",
"outputData": {
"extendContext": {
"handleBit": 1
}
},
"time": 1673406989,
"localTime": "20230111T111629",
"alarmId": "116257862023505xxxx",
"token": "f2dc8c09eeae4b5bad6abf522c93d825",
"thumbUrl": "https://example.imou.com/pic/thumb.jpg",
"picUrlArray": ["https://example.imou.com/pic/alarm1.jpg"],
"labelType": "humanAlarm",
"feedback": {
"type": 1,
"result": 1
}
}
}
}
错误码
本接口可能返回下列码。
对该条无权时整单 DV2011。alarmId 无效或不存在时返回 DV2001。告警无法映射到目录 eventId 时返回 DV2002。
include 未找到:06.dv20-message.md
