Alerts

The Urbanise "Alerts" API is used to view and acknowledge alerts from the Monitoring platform, for a specific operator.

There are two calls available:

  1. Active alerts (returns all active alerts for your operator)
  2. Acknowledge alert (clears a specific alert)

Security

In order to access the API you will need an API TOKEN which obtained from the "Operator Edit" screen by an Urbanise Super User. Please contact your Urbanise representative to obtain your API token.

Restful Interface

This is the preferred method for using the API

To use this interface GET a JSON representation of sensor data.

HTTP Verb

GET

Resource URL

https://monitoring.urbanise.com/api/v2/

Request Headers

X-Ubn-Api-Auth2: [YOUR API TOKEN]

Active Alerts

Use this API to get all alerts for your Operator ID. No parameter is required as the Operator ID is obtained from your API token.

Request Method

URL: https://monitoring.urbanise.com/api/v2/alerts

Response

A JSON array of all current alerts for your Operator.

Example below:

{
  "_id": "5893c1fcff60e50004000001",
  "message": "WARNING: Usage for the last hour was 971% the hourly average.",
  "sensor_id": "57d0fb03ccd6fb001600000b",
  "sensor_state": "warning",
  "timestamp": "2017-02-02T23:34:20+00:00"
},
{
  "_id": "5890368cf7a09f0004000065",
  "message": "ALERT: Freezing (13.8 C)",
  "sensor_id": "55acdb3c091d83001d000007",
  "sensor_state": "alert",
  "timestamp": "2017-01-31T07:02:36+00:00"
}, 
{
  "_id": "588c4b146759c80021000005",
  "message": "WARNING: Humid (70.6 %)",
  "sensor_id": "57f3c21b1bb4f8002200000b",
  "sensor_state": "warning",
  "timestamp": "2017-01-28T07:41:08+00:00"
},

Acknowledge Alerts

Use this API to acknowledge (make "not active" or "clear") a specific alert.

Request Method

URL: https://monitoring.urbanise.com/api/v2/alerts/[ALERT_ID]/ack

Response

A JSON array of all current alerts for your Operator.

Example below:

{
"result": "Closed"
}

/end