device.message.list (Query alarm history)
device.message.list: Query alarm history
What it does
Query capability event history by device and time. Response shape: data.count, data.nextAlarmId, data.messages. Each messages[] entry matches the push payload in Receive alarm messages, plus feedback (history only). msgType equals eventId.
Real-time legacy alarm / deviceStatus callbacks use string msgType and did/cid—see Receive device messages and Event message types, not this API.
beginTime / endTime are device-local yyyyMMdd'T'HHmmss (quotes mean literal T), e.g. 20201022T000000. Do not use Unix seconds or UTC from time-sync APIs. No eventIds or client count; batch size is platform-defined.
Platform fields (token, thumbUrl, picUrlArray, labelType, Smart View fields) are not inside capability outputData.
Request URL
POST https://openapi-[DataCenter].easy4ip.com/openapi/v2/device.message.list
Minimum permission
Administrator on bound devices: no extra permission. Shared devices: alarm message permission. Sub-user bound devices: none. Sub-account: per-message share/sub codes from the event’s capability row (see Permission codes)—not Alarm alone (system events often need Config). Only authorized events returned; not whole-call DV2011. Device must be bound.
Request parameters
| Name | Type | Required | Default | Valid values | Description |
|---|---|---|---|---|---|
token | String | yes | Administrator, sub-user, or sub-account accessToken | ||
deviceId | String | yes | Device serial number | ||
productId | String | no | Optional. If sent and it does not match the device model → DV2009 | ||
channelId | String | no | Channel id; IPC often "0". Do not pass -1 | Omit: device-level only; set: that channel only | |
beginTime | String | yes | Device-local yyyyMMddTHHmmss | Start time, e.g. 20201022T000000 | |
endTime | String | yes | Device-local yyyyMMddTHHmmss | End time, e.g. 20201022T235959 | |
nextAlarmId | String | no | Optional on first page | "-1" or previous batch value | First page: "-1" or omit; then previous nextAlarmId |
Request example
{
"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",
"beginTime": "20201022T000000",
"endTime": "20201022T235959",
"nextAlarmId": "-1"
}
}
Response data fields
| Name | Type | Description |
|---|---|---|
count | Int | Batch count |
nextAlarmId | String | Next batch cursor; omitted when no more |
messages | Array | Batch of push payloads; fields match Receive alarm messages plus table below |
Each messages[] entry is a push payload; only this API adds feedback
| Name | Type | Description |
|---|---|---|
msgType | String | Equals eventId, e.g. detection.motion.detected |
deviceId | String | Device serial number |
productId | String | Model |
channelId | String | Channel events; omitted on device-level |
outputData | Object | Event fields; {} when none |
time | Int | Report time, Unix seconds |
localTime | String | Device-local yyyyMMddTHHmmss |
alarmId | String | Alarm id for detail/delete/paging |
token | String | When linked cloud recording exists |
thumbUrl | String | Thumbnail; when image exists |
picUrlArray | Array | Alarm images; expire—copy promptly |
labelType | String | Message type label |
aiCopyWriting | String | Smart View when plan is active |
securityRiskLevel | Int | Smart View; matches push (1–10); Mix may normalize to level text |
aiTag | Array | Smart View; matches g04 push; Mix may normalize to single tag string |
feedback | Object | History only. type: String (1 person, 2 face, 3 LLM); result: Array<String> (e.g. ["1"] accurate / ["0"] inaccurate) |
Property reports (push channel, fixed msgType device.property.report) use properties keys as propertyId.
Response example
{
"id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
"result": {
"code": "0",
"msg": "Operation is successful",
"data": {
"count": 1,
"nextAlarmId": "116257862023505xxxx",
"messages": [
{
"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"]
}
}
]
}
}
}
Error codes
This API may return the codes below.
Unauthorized events are filtered per row; the whole call does not fail for that.
include 未找到:06.dv20-message.md
