English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Device Alert Settings

Last Updated on : 2021-09-25 06:28:05download

Query the alert or exception logs through the following APIs.

Request method API Description
GET /v1.0/illumination/sysalarm/alarms Filter the alert or exception messages under the project
GET /v1.0/illumination/sysalarm/disalarm/{projectId}/{relationId} Mark the specified alert messages as cleared

Filter the alert or exception messages under the project

Function description

Filter the alert or exception messages under the project.

API address

GET /v1.0/illumination/sysalarm/alarms

Request parameter

Parameter Data type Parameter type Description Required
projectId String body Project ID Yes
alarmType int body Type.
  • 1: alert
  • 2: exception
Yes
roomIds String[] body Collection of room ID No
categories int[] body Type collection No
start long body The start time in 13-digit timestamp No
end long body The end time in 13-digit timestamp No
keyword String body Query by keywords No
disalarm int body Filter cleared alerts No
page int body The current page. The minimum value is one and the default value is one. No
pageSize int body The number of pages. The maximum value is 10,000 and the default value is 10. No

Return parameter

Parameter Data type Description
code Integer Response code. For more information, see the error code section. It is null when the operation succeeded.
success Boolean Whether the operation succeeded. true: succeeded. false: failed.
msg String The message returned if the request fails. It will return null if the request succeeds.
t Long Return a 13-digit timestamp
result Object Return result

Description of result parameter

{
  "total": "int",
  "list": [
    {
      "id": "long //id",
      "customEventId": "String //The IDs of custom events",
      "relationId": "String //The unique identifier of this table",
      "category": "String //Category",
      "categoryCode": "String //Category code. 1: custom alert. 2: lighting. 3: electrical products. 4: security",
      "projectId": "String //Project ID",
      "roomId": "String //Room ID",
      "roomName": "String //Room name",
      "deviceId": "String //Device ID",
      "deviceName": "String //Device name",
      "deviceTopCategory": "String //Device category",
      "alarmEvent": "String //Alert event",
      "alarmTime": "long //Alert time",
      "alarmType": "int //Type. 1: alert. 2: exception",
      "alarmSubType": "int //Sub-types of alert or exception. 0: Alerts or exceptions from custom events. 1: Device offline",
      "disalarm": "boolean //Whether an alert is cleared",
      "disalarmTime": "long //Time when an alert is cleared"
    }
  ]
 }

Sample request

{
  "alarmType": "Type. 1: alarm. 2: exception",
  "projectId": "Project ID"
 }

Sample response

{
  "total": "25",
  "list": [
    {
      "id": "1",
      "customEventId": "12231562452233",
      "relationId": "126762133346134",
      "category": "custom alarm",
      "categoryCode": "1",
      "projectId": "12447741234544",
      "roomId": "1245690043468883",
      "roomName": "test room",
      "deviceId": "146894336893225",
      "deviceName": "test device",
      "deviceTopCategory": "zm",
      "alarmEvent": "test alarm",
      "alarmTime": "1615461449136",
      "alarmType": "1",
      "alarmSubType": "0",
      "disalarm": "false"
    }
  ]
 }

Mark the specified alert messages as cleared

Function description

Mark the specified alert messages as cleared.

API address

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

Request parameter

Parameter Data type Parameter type Description Required
relationId String url Alert record ID Yes
projectId String url Project ID Yes

Return parameter

Parameter Data type Description
code Integer Response code. For more information, see the error code section. It is null when the operation succeeded.
success Boolean Whether the operation succeeded. true: succeeded. false: failed.
msg String The message returned if the request fails. It will return null if the request succeeds.
t Long Return a 13-digit timestamp
result Object Return result

Description of result parameter

boolean{}

Sample request

{
 "relationId": "Alarm record ID"
 }

Sample response

true

Error code

The following are common service exceptions for this API. For more information, see global error codes.

Error code Description
500 System error