Rest API (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.

Download OpenAPI description
Languages
Servers
Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/
Production
https://api.wia.io/v1/

Alert

Alerts provide information about devices that have gone offline or exhibited anomalies in their data, helping to monitor system health and identify potential issues.
Alerts can be resolved by acknowledging them, and can be filtered by their resolution status.

Operations

Retrieves a list of alerts in a Space

Request

Retrieves a list of alerts in a Space

Query
unresolvedboolean

Returns only unresolved alerts

resolvedboolean

Returns only resolved alerts

organisation.idstring

Id of Organisation

product.idstring

Id of Product

space.idstring

Id of Space

alertRule.idstring

Id of Alert Rule

limitinteger(int32)

Max number of rows to return

Example: limit=20
pageinteger(int32)

Section of rows to return e.g. 0, 1 or 2

sortstring

Sort by Ascending or Descending order Default: DESC

Enum"ASC""DESC"
orderstring

Order by column e.g. id

sincestring or integer

Retrieve from this timestamp onwards

One of:
string(date-time)
untilstring or integer

Retrieve until this timestamp

One of:
string(date-time)
curl -i -X GET \
  'https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts?alertRule.id=string&limit=20&order=string&organisation.id=string&page=0&product.id=string&resolved=true&since=2022-01-01T00%3A00%3A00Z&sort=ASC&space.id=string&unresolved=true&until=2022-01-01T00%3A00%3A00Z' \
  -H 'Authorization: Bearer <YOUR_Bearer_HERE>'

Responses

OK

Bodyapplication/jsonArray [
idstring
Example: "alt_abcdef12345678"
eventobject(Event)
notestring
Example: "A window was opened"
resolvedAtstring(date-time)
Example: 1642759067045
acknowledgedAtstring(date-time)
Example: 1642759067045
firstSeenAtstring(date-time)
Example: 1642759067045
lastSeenAtstring(date-time)
Example: 1642759067045
deviceobject(Device)
gatewayobject(Gateway)
alertRuleobject(AlertRule)
createdAtinteger
Example: 1642759067045
updatedAtinteger
Example: 1642759067045
]
Response
application/json
[ { "id": "alt_abcdef12345678", "event": {}, "note": "A window was opened", "resolvedAt": 1642759067045, "acknowledgedAt": 1642759067045, "firstSeenAt": 1642759067045, "lastSeenAt": 1642759067045, "device": {}, "gateway": {}, "alertRule": {}, "createdAt": 1642759067045, "updatedAt": 1642759067045 } ]

Retrieves an alert

Request

Retrieves an alert

Path
idstringrequired

Id of the alert

curl -i -X GET \
  'https://docs.wia.io/_mock/apis/wia-rest-api/docs/alerts/{id}' \
  -H 'Authorization: Bearer <YOUR_Bearer_HERE>'

Responses

OK

Bodyapplication/json
idstring
Example: "alt_abcdef12345678"
eventobject(Event)
notestring
Example: "A window was opened"
resolvedAtstring(date-time)
Example: 1642759067045
acknowledgedAtstring(date-time)
Example: 1642759067045
firstSeenAtstring(date-time)
Example: 1642759067045
lastSeenAtstring(date-time)
Example: 1642759067045
deviceobject(Device)
gatewayobject(Gateway)
alertRuleobject(AlertRule)
createdAtinteger
Example: 1642759067045
updatedAtinteger
Example: 1642759067045
Response
application/json
{ "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, "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 }

Update the resolution status of an alert

Request

Update the resolution status of an alert

Path
idstringrequired

Id of the alert

Bodyapplication/json
resolvedAtnumber
acknowledgedAtnumber
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
  }'

Responses

OK

Bodyapplication/json
idstring
Example: "alt_abcdef12345678"
eventobject(Event)
notestring
Example: "A window was opened"
resolvedAtstring(date-time)
Example: 1642759067045
acknowledgedAtstring(date-time)
Example: 1642759067045
firstSeenAtstring(date-time)
Example: 1642759067045
lastSeenAtstring(date-time)
Example: 1642759067045
deviceobject(Device)
gatewayobject(Gateway)
alertRuleobject(AlertRule)
createdAtinteger
Example: 1642759067045
updatedAtinteger
Example: 1642759067045
Response
application/json
{ "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, "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 }

Device

Devices are a representation of objects that are connected to the Wia platform and can be used to collect data from the environment. The objects can be physical sensors, cloud integrations or manual uploads.

Operations

Energy

Energy consumption data is used to track the amount of energy used by a customer over a given time period.
The data can be used to identify energy-saving opportunities, monitor energy usage for sustainability initiatives, and track energy usage for billing purposes.

Operations

Gateway

Gateways are devices that connect to the Wia platform and are used to transport data from other devices in the environment to the Wia platform.

Operations

Space

Spaces are physical locations that are monitored by the Wia platform and house all devices and gateways that represent that location.

Operations