Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
    • Public conventions
    • Development specification
    • accessToken: Get administrator token
    • API request example
    • Return codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • Legacy APIs (deprecated)
      • Door lock access (legacy)
      • Device messages (legacy)
        • deleteAlarmMessage
        • getAlarmMessage
        • getAlarmMessageById
      • Device query (deprecated)
      • Device maintenance (legacy)
      • Device operation (legacy)
      • Device ability (legacy)
      • Motion detection config (legacy)
      • Preset collection (legacy)
      • Timed cruise (legacy)
      • Local recording config (legacy)
      • Audio volume (legacy)
      • Storage (legacy)
      • Video and imaging (legacy)
      • Time zone (legacy)
      • Wi-Fi (legacy)
      • Local recording query (legacy)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Function details
Request address
Request format
Minimum permissions required for sub-account token request
Incoming parameter description
Sample input
Return data field description
Sample output
Error codes
Related

getAlarmMessage (getAlarmMessage: Query user alarm information)

getAlarmMessage: getAlarmMessage: Query user alarm information

Legacy HTTP retained: New integrations can use Alarm messages (device.message.list) for the related capability. The two interfaces are not a one-to-one replacement. device.message.* is a related entry, not a one-to-one replacement of this HTTP method.

Function details

Get the device message list of the device channel in the specified time period.

Legacy OpenAPI pagination. Capability event history: Query alarm history (device.message.list).

Request address

https://openapi-[DataCenter].easy4ip.com/openapi/getAlarmMessage

Request format

HTTP POST. JSON body layout: Request conventions. Sign with Signature.

Minimum permissions required for sub-account token request

"Permission":"Alarm" "Resource":"cam:serial number:channel number"

Incoming parameter description

Parameter nameParameter typeRequired or notDefault valueLegal valueParameter description
tokenStringYesAdministrator or sub-account accessToken
deviceIdStringYesDevice serial number
channelIdStringYesChannel Number
beginTimeStringYesStart time, yyyy-MM-dd HH:mm:ss
endTimeStringYesEnd time, yyyy-MM-dd HH:mm:ss
countIntegerNo30[1,100]The total number of alarms extracted, [1,100] a positive integer
nextAlarmIdStringNo"-1""","-1", the nextAlarmId returned by the last querythe next alarm Id

Sample input

{
 "system":{
 "ver":"1.0",
 "appId":"lcdxxxxxxxxx",
 "sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
 "time":1603350704,
 "nonce":"245db3c7-1689-4893-ac30-cbd7a9d8d153"
 },
 "id":"9f05aa70-91fd-4d35-8b06-cd2ece55346b",
 "params":{
 "count":"10",
 "beginTime":"2020-10-22 00:00:00",
 "endTime":"2020-10-22 23:59:59",
 "deviceId":"TESTQWERXXXX",
 "channelId":"0",
 "nextAlarmId":"-1",
 "token":"At_00000ad9e6e87f0142eb92e207aec46a"
 }
}

Return data field description

FieldTypeDescription
countIntegerTotal number of current extracted alarms
alarms.tokenStringThe unique identifier of the message, used to query cloud recordings
alarms.timeLongUNIX timestamp of alarm time (unit: second)
alarms.channelIdStringChannel number
alarms.nameStringChannel name
alarms.alarmIdLongMessage Id
alarms.localDateStringThe local time of the device at the time of alarm
alarms.typeIntegerAlarm type, 0: human infrared; 1: dynamic detection; 2: unknown alarm; 3: low voltage alarm; 4: infrared detection of accessories human body; 5: movement event of the mobile sensor; 6: long-term movement of the mobile sensor No movement event occurred; 7: Long-term non-alarm event due to infrared detection of accessory human body; 8: Door sensor alarm event; 90: Alarm gateway door sensor detection alarm; 91: Alarm gateway infrared detection alarm; 92: Alarm gateway low battery alarm; 93: Alarm gateway tampering alarm
alarms.deviceIdStringDevice ID
alarms.picurlArrayString[]Alarm picture url
alarms.thumbUrlStringThumbnail Url
nextAlarmIdLongThe message Id of the last message in the current message list

Sample output

{
 "result":{
 "msg":"The operation was successful",
 "code":"0",
 "data":{
 "alarms":[
 {
 "alarmId":"1726360834259136",
 "name":"TP1S-1842",
 "time":1603350842,
 "localDate":"2020-10-22 15:14:02",
 "type":"1",
 "thumbUrl":"https://storage.example.com/alarm/07540ab39e82488490b232977c333c9e_0_thumb.dav?Expires=1603437367&AccessKeyId=EXAMPLE&Signature=EXAMPLE",
 "deviceId":"TESTQWERXXXX",
 "picurlArray":[
 "https://storage.example.com/alarm/07540ab39e82488490b232977c333c9e_0.jpg?Expires=1603437367&AccessKeyId=EXAMPLE&Signature=EXAMPLE"
 ],
 "channelId":"0",
 "token":"07540ab39e82488490b232977c333c9e"
 },
 {
 "alarmId":"1726360340019392",
 "name":"TP1S-1842",
 "time":1603350721,
 "localDate":"2020-10-22 15:12:01",
 "type":"1",
 "thumbUrl":"https://storage.example.com/alarm/ccea3589e6484646b0bc9f97f45dd8c5_0_thumb.dav?Expires=1603437367&AccessKeyId=EXAMPLE&Signature=EXAMPLE",
 "deviceId":"TESTQWERXXXX",
 "picurlArray":[
 "https://storage.example.com/alarm/ccea3589e6484646b0bc9f97f45dd8c5_0.jpg?Expires=1603437367&AccessKeyId=EXAMPLE&Signature=EXAMPLE"
 ],
 "channelId":"0",
 "token":"ccea3589e6484646b0bc9f97f45dd8c5"
 }
 ],
 "count":2,
 "nextAlarmId":1726360340019392
 }
 },
 "id":"9f05aa70-91fd-4d35-8b06-cd2ece55346b"
}

Error codes

This method may return the codes below. See Return codes and Capability errors for the full catalog.

Gateway and auth (SN / TK / OP)

CodeMeaningNext step
SN1001Signature errorCheck sign per Development specification
TK1002Token invalid or expiredRefresh accessToken
OP1002Missing required parameterAdd required fields
OP1003Invalid parameterMatch this page’s parameter table
OP1009Permission deniedCheck token and device bind/share grants
OP1013Total call limit exceededReduce call rate
OP1014Daily per-interface limit exceededSee Interface call limits
DV1007Device offlineWait until the device is online

See Return codes · OP/SN/TK for the full catalog.

Sub-accounts (SUB)

CodeMeaningNext step
SUB1001–SUB1002Sub-account lacks API permissionUpdate policy via addPolicy
SUB1005Sub-account token expiredRefresh subAccountToken
SUB1006No device grant for sub-accountCheck Resource and device serial
SUB1008Sub-account not bound to appCreate and bind the sub-account first

See Return codes · SUB.

Device access and channels (DV10xx)

CodeMeaningNext step
DV1007Device offline or timeoutWait for the device to come online
DV1009Device busyRetry later
DV1012Insufficient share/grant permissionCheck sub-account Permission / Resource
DV1019Capability not supportedConfirm model and capability list
DV1020Channel offlineCheck channel status
DV1026Function not supportedUse another API or upgrade firmware
DV1028Not bound or channel missingVerify deviceId / channelId

See Return codes · DV.

Related

  • Development specification
  • API conventions
  • Module index
deleteAlarmMessage
getAlarmMessageById