Device Alerts

Last Updated on : 2023-12-22 03:47:01download

This topic describes how to call API operations to query device alerts.

Request method API endpoint Description
POST /v1.0/cloud/illume/sysalarm/alarms Filter device alerts/custom alerts by project
GET /v1.0/illumination/sysalarm/disalarm/{projectId}/{relationId} Mark the specified alert as canceled

Filter device alerts/custom alerts by project

API description

Filter the device alerts and custom alerts by project.

API endpoint

POST /v1.0/cloud/illume/sysalarm/alarms

Request parameter

Parameter name Data type Parameter type Description Required
projectId String body The project ID. Yes
alarmType int body The alert types. Valid values:
  • 1: custom alert
  • 2: device alert
Yes
roomIds List< String > body The list of room IDs. No
deviceName String body The device name. No
deviceId String body The device ID. No
lastAlarmStart long body The 13-digit timestamp when the last alert starts. No
lastAlarmEnd long body The 13-digit timestamp when the last alert ends. No
disalarm int body The alert status. Valid values:
  • -1: all.
  • 1: the alert is canceled.
  • 0: the alert is not canceled. If not specified, the default value is 0.
No
page int body The current page number starting from 1. Yes
pageSize int body The number of items returned on each page. Maximum value: 100, recommended value: 20. Yes

Response parameter

Parameter name Data type Description
code Integer The response code. For more information, see the error code section. It is empty if the request is successful.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: success
  • false: failure
msg String The message that is returned if the request failed. The response is empty if the request is successful.
t Long The returned 13-digit timestamp.
result Object The returned result.

Description of result

{
  "result":{
    "list":[
      {
        "relationId": "String // The ID of the specified alert history",
        "projectId": "String // The project ID",
        "roomId": "String // The room ID",
        "roomName": "String // The name of the room to which the device belongs.",
        "deviceId": "String // The device ID",
        "deviceName": "String // The device name",
        "deviceTopCategory": "String // The device category",
        "alarmEvent": "String // The description of the alert event",
        "alarmType": "int // The alert type, 1: custom alert, 2: device alert",
        "disalarm": "boolean // The alert status, true: canceled, false: not canceled",
        "disalarmTime": "long // The time when the alert was canceled",
        "lastAlarmTime":"long // The time when the last alert was triggered"
      }
    ],
    "total":1
  },
  "success":true,
  "t":1702459727383,
  "tid":"12444f864fbcabd0"
}

Sample request

{
  "alarmType": "The alert type, 1: custom alert, 2: device alert",
  "projectId": "The project ID",
  "disalarm": "The alert status, -1: all, 1: canceled, 0: not canceled",
  "page": 1,
  "pageSize":20
}

Sample response

{
  "result":{
    "list":[
      {
        "relationId": "126762133346134",
        "projectId": "12447741234544",
        "roomId": "1245690043468883",
        "roomName": "Test Space",
        "deviceId": "146894336893***",
        "deviceName": "Test Device",
        "deviceTopCategory": "zm",
        "alarmEvent": "Going Offline",
        "alarmType": 2,
        "disalarm": false,
        "disalarmTime": 0,
        "lastAlarmTime":1615461449136,
        "alarmOccurCount": 1
      }
    ],
    "total":1
  },
  "success":true,
  "t":1702459727383,
  "tid":"12444f864fbcabd0"
}

Mark the specified alert as canceled

API description

Mark the specified message as clearing the alert.

API endpoint

GET /v1.0/illumination/sysalarm/disalarm/{projectId}/{relationId}

Request parameter

Parameter name Data type Parameter type Description Required
relationId String url The ID of the specified alert history. Yes
projectId String url The project ID. Yes

Response parameter

Parameter name Data type Description
code Integer The response code. For more information, see the error code section. It is empty if the request is successful.
success Boolean Indicates whether the operation is successful. Valid values:
  • true: success
  • false: failure
msg String The message that is returned if the request failed. The response is empty if the request is successful.
t Long The returned 13-digit timestamp.
result Object The returned result.

Description of result

boolean{}

Sample request

{
  "relationId": "The ID of the specified alert history"
}

Sample response

true

Error code

The following table lists common error codes returned in the API calls. For more error codes, see Global Error Codes.

Error code Description
500 A system error has occurred while processing your request.