Retrieves a list of alerts in a Space
- Retrieves a list of alerts in a Space
Wia REST API reference (v1)
A REST API to interact with Wia platform to enable external applications to analyse energy consumption and to automate internal operations relating to the capturing and grouping of energy consumption.
To get started, please ensure you have the correct permissions and appropriate key. If you have not been provided a key, please contact your representative.
The API is organised around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts
- Production
https://api.wia.io/v1/alerts
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts?unresolved=true&resolved=true&organisation.id=string&product.id=string&space.id=string&alertRule.id=string&limit=20&page=0&sort=ASC&order=string&since=2022-01-01T00%3A00%3A00Z&until=2022-01-01T00%3A00%3A00Z' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>'
[ { "id": "alt_abcdef12345678", "event": { … }, "note": "A window was opened", "resolvedAt": 1642759067045, "acknowledgedAt": 1642759067045, "firstSeenAt": 1642759067045, "lastSeenAt": 1642759067045, "device": { … }, "gateway": { … }, "alertRule": { … }, "createdAt": 1642759067045, "updatedAt": 1642759067045 } ]
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts/{id}
- Production
https://api.wia.io/v1/alerts/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts/{id}' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>'
{ "id": "alt_abcdef12345678", "event": { "id": "1234-abcd-5678-efgh", "name": "Test Event", "data": { … }, "timestamp": 1631707200000 }, "note": "A window was opened", "resolvedAt": 1642759067045, "acknowledgedAt": 1642759067045, "firstSeenAt": 1642759067045, "lastSeenAt": 1642759067045, "device": { "id": "dev_abc123", "isMain": true, "isActive": true, "name": "Test Device", "customId": "custom-id", "serialNumber": "abc12345678", "batchNumber": "123", "space": { … }, "product": { … }, "events": [ … ], "location": { … }, "state": {}, "meta": {}, "wifi": { … }, "cellular": { … }, "bluetooth": { … }, "lora": { … }, "sigfox": { … }, "lastSeenAt": 1631707207000, "lastUnprocessedEventTimestamp": 1631707207000, "lastProcessedEventTimestamp": 1631707207000, "createdAt": 1631707207000, "updatedAt": 1631707207000 }, "gateway": { "id": "gty_123abc456", "serialNumber": "abc_23243456", "name": "Test Gateway", "product": { … }, "isOnline": true, "lora": { … }, "lastSeenAt": 1631707207000 }, "alertRule": { "id": "alt_abcdef12345678", "name": "Gateway offline", "type": "email", "severity": "high", "enabled": true, "autoResolve": false, "config": {}, "organisation": { … }, "product": { … }, "space": { … }, "notificationTemplate": { … }, "createdAt": 1642759067045, "updatedAt": 1642759067045 }, "createdAt": 1642759067045, "updatedAt": 1642759067045 }
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts/{id}/resolve
- Production
https://api.wia.io/v1/alerts/{id}/resolve
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts/{id}/resolve' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"resolvedAt": 0,
"acknowledgedAt": 0
}'
{ "id": "alt_abcdef12345678", "event": { "id": "1234-abcd-5678-efgh", "name": "Test Event", "data": { … }, "timestamp": 1631707200000 }, "note": "A window was opened", "resolvedAt": 1642759067045, "acknowledgedAt": 1642759067045, "firstSeenAt": 1642759067045, "lastSeenAt": 1642759067045, "device": { "id": "dev_abc123", "isMain": true, "isActive": true, "name": "Test Device", "customId": "custom-id", "serialNumber": "abc12345678", "batchNumber": "123", "space": { … }, "product": { … }, "events": [ … ], "location": { … }, "state": {}, "meta": {}, "wifi": { … }, "cellular": { … }, "bluetooth": { … }, "lora": { … }, "sigfox": { … }, "lastSeenAt": 1631707207000, "lastUnprocessedEventTimestamp": 1631707207000, "lastProcessedEventTimestamp": 1631707207000, "createdAt": 1631707207000, "updatedAt": 1631707207000 }, "gateway": { "id": "gty_123abc456", "serialNumber": "abc_23243456", "name": "Test Gateway", "product": { … }, "isOnline": true, "lora": { … }, "lastSeenAt": 1631707207000 }, "alertRule": { "id": "alt_abcdef12345678", "name": "Gateway offline", "type": "email", "severity": "high", "enabled": true, "autoResolve": false, "config": {}, "organisation": { … }, "product": { … }, "space": { … }, "notificationTemplate": { … }, "createdAt": 1642759067045, "updatedAt": 1642759067045 }, "createdAt": 1642759067045, "updatedAt": 1642759067045 }