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
    • Error codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • AI analysis
    • AI Insight
      • bindDeviceAiInsight: Enable AI Insight package
      • unbindDeviceAiInsight: Unbind AI Insight package
      • queryDeviceAiInsight: Query active AI Insight package
      • queryDeviceAiInsightList: List AI Insight packages on channel
      • queryAiInsightCount: Query AI Insight purchase quota
      • queryUnusedAiInsightList: List unused AI Insight packages
      • setDeviceAiInsightSwitch: Set AI Insight service switch
      • activateDeviceAiInsight: Activate queued AI Insight package
      • setDeviceAiLanguage: Set channel AI language
      • addAiInsightFeature: Add face library member
      • updateAiInsightFeature: Update face library member
      • addAiInsightFaceImages: Append face registration images
      • deleteAiInsightFaceImages: Delete face registration images
      • listAiInsightFeature: List registered face members
      • deleteAiInsightFeature: Delete face members
      • listAiInsightUnknownFace: List unknown face clusters
      • deleteAiInsightUnknownFace: Delete unknown face images
      • queryCondensedRecordBitmap: Query AI Insight highlight calendar mask
      • getCondensedRecords: Query AI Insight highlight clips
      • searchAiAlarmMessageByPage: Search alarm messages by keyword
      • getAlarmMessageStatistics: Daily alarm statistics and safety report
      • reportAiMsgFeedback: Submit AI smart-alarm accuracy feedback
    • Legacy APIs (deprecated)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
What it does
Request URL
Minimum permission
Request parameters
Sample input
Return data fields
Sample output
Error codes
Notes
Related

getAlarmMessageStatistics: Daily alarm statistics and safety report

getAlarmMessageStatistics: Daily alarm statistics and safety report

What it does

Returns per-day alarm counts and optional AI risk / time-window analysis (daily safety brief) for a device channel. Reports are generated only when AI Insight or AI Insight cloud storage is active on the channel.

Request URL

POST https://openapi-[DataCenter].easy4ip.com/openapi/getAlarmMessageStatistics

Minimum permission

Administrator or sub-account token. See Permission codes.

Request parameters

Parameter nameParameter typeRequired or notParameter description
tokenStringYesAdministrator or sub-account accessToken
deviceIdStringYesDevice serial number
channelIdStringYesChannel ID
startDayStringYesStart date Allowed values: yyyyMMdd.
endDayStringYesEnd date; must be ≥ startDay Allowed values: yyyyMMdd.
productIdStringNoThing-model product ID (optional)
multiViewIntegerNoLens count on multi-sensor devices, e.g. 2 for dual-lens; omit for single-lens Default 1. Allowed values: ≥1.
aiStatisticsAnalysisEnableBooleanNoSet true to include AI time/label analysis when Insight or Insight cloud storage is active Default false.
msgAnalysisObjectNoCustom AI analysis (see nested rows)
msgAnalysis.analysisHourIntervalIntegerNoBucket size in hours, e.g. 2
msgAnalysis.labelTimeArrayNoTop events per label; items: labelType, count, sortType (desc/asc)
msgAnalysis.labelTime[].labelTypeStringNoLabel type Allowed values: e.g. humanAlarm.
msgAnalysis.labelTime[].countInteger / StringNoMax items to return
msgAnalysis.labelTime[].sortTypeStringNoSort order Allowed values: desc, asc.
riskStatementArrayNoRisk hour windows; items: startHour, endHour (e.g. 00, 05)
riskStatement[].startHourStringNoStart hour
riskStatement[].endHourStringNoEnd hour

Common request fields and signing: Signing conventions and Common request payload.

Sample input

{
  "id": "9f05aa70-91fd-4d35-8b06-cd2ece55346b",
  "system": {
    "ver": "1.0",
    "appId": "lcdxxxxxxxxx",
    "sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
    "time": 1603350704,
    "nonce": "245db3c7-1689-4893-ac30-cbd7a9d8d153"
  },
  "params": {
    "token": "<yourAccessToken>",
    "deviceId": "TESTQWERXXXX",
    "channelId": "0",
    "startDay": "20260427",
    "endDay": "20260428",
    "aiStatisticsAnalysisEnable": true,
    "msgAnalysis": {
      "analysisHourInterval": 2,
      "labelTime": [
        {
          "labelType": "petAlarm",
          "count": 10,
          "sortType": "desc"
        }
      ]
    },
    "riskStatement": [
      {
        "startHour": "00",
        "endHour": "05"
      }
    ]
  }
}

Return data fields

Field nameField typeField description
aiStatisticsAnalysisResultArrayPer-day AI analysis
aiStatisticsAnalysisResult[].analysisDayStringDate yyyyMMdd
aiStatisticsAnalysisResult[].riskStatementInfoArrayRisk window stats
aiStatisticsAnalysisResult[].riskStatementInfo[].startHourStringStart hour
aiStatisticsAnalysisResult[].riskStatementInfo[].endHourStringEnd hour
aiStatisticsAnalysisResult[].riskStatementInfo[].countString / IntegerEvent count
aiStatisticsAnalysisResult[].riskStatementInfo[].riskEventDocStringAI risk description
aiStatisticsAnalysisResult[].msgAnalysisInfoArrayLabel time distribution
aiStatisticsAnalysisResult[].msgAnalysisInfo[].labelTypeStringe.g. humanAlarm
aiStatisticsAnalysisResult[].msgAnalysisInfo[].alarmDateTimeArrString[]Sample alarm times
aiStatisticsAnalysisResult[].msgAnalysisInfo[].timeDistributeInteger[]Counts per bucket
statisticsArrayDaily rollups
statistics[].dateStringDate yyyyMMdd
statistics[].totalcountIntegerTotal alarms that day
statistics[].bigModelStatisticsLabelsArrayAI label summary
statistics[].humanAlarmIntegerPerson detection count
statistics[].carAlarmIntegerVehicle detection count
statistics[].petAlarmIntegerPet detection count
statistics[].packageAlarmIntegerPackage detection count
statistics[].faceAlarmIntegerFace detection count
statistics[].motionAlarmIntegerMotion detection count
statistics[].otherIntegerOther events
statistics[].abSoundAlarmIntegerAbnormal sound
statistics[].peopleFallAlarmIntegerFall detection
statistics[].suspectedPeopleFallAlarmIntegerSuspected fall
statistics[].voiceHelpAlarmIntegerVoice help
statistics[].stayoverAlarmIntegerLoitering
statistics[].cryingAlarmIntegerCrying
statistics[].callAlarmIntegerCall events

Sample output

{
  "result": {
    "msg": "Success.",
    "code": "0",
    "data": {
      "aiStatisticsAnalysisResult": [
        {
          "analysisDay": "20250227",
          "riskStatementInfo": [
            {
              "startHour": "00",
              "endHour": "05",
              "count": 10,
              "riskEventDoc": "A person in a dark coat stood with their back to the camera"
            }
          ],
          "msgAnalysisInfo": [
            {
              "labelType": "humanAlarm",
              "alarmDateTimeArr": [
                "2025-02-27 08:15:00"
              ],
              "timeDistribute": [
                0,
                0,
                0,
                5,
                0,
                2
              ]
            }
          ]
        }
      ],
      "statistics": [
        {
          "bigModelStatisticsLabels": [],
          "totalcount": 20,
          "date": "20260327",
          "other": 5,
          "abSoundAlarm": 0,
          "petAlarm": 10,
          "carAlarm": 0,
          "faceAlarm": 2,
          "motionAlarm": 3,
          "humanAlarm": 0,
          "peopleFallAlarm": 0,
          "suspectedPeopleFallAlarm": 0,
          "packageAlarm": 0,
          "voiceHelpAlarm": 0,
          "stayoverAlarm": 0,
          "cryingAlarm": 0,
          "callAlarm": 0
        }
      ]
    }
  },
  "id": "9f05aa70-91fd-4d35-8b06-cd2ece55346b"
}

Error codes

See Error codes and Capability errors.

Gateway and auth (SN / TK / OP)

CodeMeaningNext step
SN1001Signature errorCheck sign per Signature
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 Error 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 Error codes · SUB.

Alarms and messages (DV20xx)

CodeMeaningNext step
DV2001Message not foundVerify alarm id
DV2002Message query failedCheck time range and permissions

See Error codes · catalog.

Notes

Sub-account tokens need at least Permission Alarm and Resource cam:{deviceId}:{channelId}. See Permission codes.

Related

  • AI Insight APIs
  • searchAiAlarmMessageByPage: Search alarm messages by keyword
  • Development guide
searchAiAlarmMessageByPage: Search alarm messages by keyword
reportAiMsgFeedback: Submit AI smart-alarm accuracy feedback