Active Alarms

The /alarms/active URL provides the ability to retrieve active device alarms.

URL

/api/v1/alarms/active

HTTP Method

GET

Supported Parameters

Parameter

Type

Description

?limit=<value>

Number

Limits response to a specified number of alarms. Note that the device may return fewer alarms – e.g. if no more alarms exist or if the user‑specified number is too large.

Default = 20.

?after=<value>

As returned in previous response

Returns alarms after the alarm specified by the cursor. The cursor value should be taken from “cursor” element in the previous response.

?before=<value>

As returned in previous response

Returns alarms before the alarm specified by the cursor (backwards search). The cursor value should be taken from the “cursor” element in the previous response.

HTTP Responses

200 OK
204 No Content – when no alarms are found

Example 1

Request:
GET /api/v1/alarms/active HTTP/1.1
Host: 10.4.219.229
Response:
 HTTP/1.1 200 OK
Content-Type: application/json
{
    "alarms": [
        {
            "id": "1",
            "description": "Trunk is down",
            "url": "/api/v1/alarms/active/1"
        },
        {
            "id": "2",
            "description": "Device will explode in 15 min",
            "url": "/api/v1/alarms/active/2"
        }
    ],
    "cursor": {
        "after": "2",
        "before": "-1"
    }
}

The 200 OK response includes the “cursor” structure that includes “before” and “after” cursors that may be used in consequent requests. Value “-1” indicates than no more alarms before or after exist.

Example 2

Request:
GET /api/v1/alarms/active?after=2 HTTP/1.1
Host: 10.4.219.229 
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
    "alarms": [
        {
            "id": "3",
            "description": "Intrusion detected",
            "url": "/api/v1/alarms/active/3"
        }
    ],
    "cursor": {
        "after": "-1",
        "before": "3"
    }
} 

Example 3

Request:
GET /api/v1/alarms/active?after=3 HTTP/1.1
Host: 10.4.219.229 
Response:
 HTTP/1.1 204 No Content