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

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

The API endpoint retrieves electricity consumption

Request

The API endpoint retrieves electricity consumption data in kilowatt-hours (kWh) from electricity meters.

The endpoint utilizes the underlying data from the meters to calculate and return the energy consumed by a customer during a given time period.

To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.

The endpoint will then gather underlying stores of meter readings and calculate the total energy consumed by the customer for a specified time resolution

The energy consumption data will be returned in kWh, which is the standard unit of measurement for electricity consumption and the time units are in UTC.

If the metres use current usage to read energy consumption, that is also outputted by the API endpoint with the same format as power consumption.

This API endpoint can be useful for a variety of applications, such as tracking energy usage for billing purposes, identifying energy-saving opportunities, and monitoring energy usage for sustainability initiatives.

Query
space.idstring

Id of Space

device.idstring

Id of Device

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)
continuationTokenstring

The continuation token to retrieve the next set of data.

timezonestring

The timezone to use for the data retrieval. If not specified, the timezone will be set to Space timezone offset to UTC.

Example: timezone=Europe/London
intervalstring^\d+\s+(minute|hour|day|week|month)$

Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.

Default "1 hour"
Example: interval=2 hours
breakdownstring

The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.

Enum"device""country"
currentstring

The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
previousstring

The previous time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
sourcestring

The source of the data to retrieve. Where its grid, solar or wind.

Enum"grid""solar""wind"
flowstring

Whether the energy usage is consumed or produced.

Enum"consumption""production"
curl -i -X GET \
  'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/electricity?breakdown=device&continuationToken=string&current=hour&device.id=string&flow=consumption&interval=2%20hours&previous=hour&since=2022-01-01T00%3A00%3A00Z&source=grid&space.id=string&timezone=Europe%2FLondon&until=2022-01-01T00%3A00%3A00Z' \
  -H 'Authorization: Bearer <YOUR_Bearer_HERE>'

Responses

OK

Bodyapplication/json
One of:
devicesobject
Example: {"dev_abc123":[{"energy":"1000","timestamp":1631707200000}],"dev_def456":[{"energy":"2000","timestamp":1631707200000}]}
resultArray of objects(EnergyReading)required
result[].​energystring
Example: "1000"
result[].​timestampinteger
Example: 1631707200000
continuationTokenstring or null
Example: "eyJ0bpo92Dd2twl7ko1="
Response
application/json
{ "devices": { "dev_abc123": [], "dev_def456": [] }, "result": [ {} ], "continuationToken": "eyJ0bpo92Dd2twl7ko1=" }

The API endpoint retrieves Gas consumption data in

Request

The API endpoint retrieves Gas consumption data in (m³) from gas meters.

The endpoint utilizes the underlying data from the meters to calculate and return the gas consumed by a customer during a given time period.

To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.

The endpoint will then gather underlying stores of meter readings and calculate the total gas consumed by the customer during the specified time period such as 15 minutes, 2 hours, 1 day etc.

The gas consumption data will be returned in m³, which is the standard unit of measurement for gas consumption and the time units are in UTC.

This API endpoint can be useful for a variety of applications, such as tracking gas usage for billing purposes, identifying consumption saving opportunities, and monitoring usage for sustainability initiatives.

Query
space.idstring

Id of Space

device.idstring

Id of Device

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)
continuationTokenstring

The continuation token to retrieve the next set of data.

intervalstring^\d+\s+(minute|hour|day|week|month)$

Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.

Default "1 hour"
Example: interval=2 hours
breakdownstring

The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.

Enum"device""country"
currentstring

The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
previousstring

The previous time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
curl -i -X GET \
  'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/gas?breakdown=device&continuationToken=string&current=hour&device.id=string&interval=2%20hours&previous=hour&since=2022-01-01T00%3A00%3A00Z&space.id=string&until=2022-01-01T00%3A00%3A00Z' \
  -H 'Authorization: Bearer <YOUR_Bearer_HERE>'

Responses

OK

Bodyapplication/json
One of:
devicesobject
Example: {"dev_abc123":[{"gas":"1000","timestamp":1631707200000}],"dev_def456":[{"gas":"2000","timestamp":1631707200000}]}
resultArray of objects(GasReading)required
result[].​energystring
Example: "1000"
result[].​timestampinteger
Example: 1631707200000
continuationTokenstring or null
Example: "eyJ0bpo92Dd2twl7ko1="
Response
application/json
{ "devices": { "dev_abc123": [], "dev_def456": [] }, "result": [ {} ], "continuationToken": "eyJ0bpo92Dd2twl7ko1=" }

The API endpoint retrieves Water consumption data

Request

The API endpoint retrieves Water consumption data in (m³) from water meters.

The endpoint utilizes the underlying data from the meters to calculate and return the water consumed by a customer during a given time period.

To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.

The endpoint will then gather underlying stores of meter readings and calculate the total water consumed by the customer during the specified time period such as 15 minutes, 2 hours, 1 day etc.

The water consumption data will be returned in m³, which is the standard unit of measurement for water consumption and the time units are in UTC.

This API endpoint can be useful for a variety of applications, such as tracking water usage for billing purposes, identifying consumption saving opportunities, and monitoring usage for sustainability initiatives.

Query
space.idstring

Id of Space

device.idstring

Id of Device

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)
continuationTokenstring

The continuation token to retrieve the next set of data.

timezonestring

The timezone to use for the data retrieval. If not specified, the timezone will be set to Space timezone offset to UTC.

Example: timezone=Europe/London
intervalstring^\d+\s+(minute|hour|day|week|month)$

Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.

Default "1 hour"
Example: interval=2 hours
breakdownstring

The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.

Enum"device""country"
currentstring

The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
previousstring

The previous time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.

Enum"hour""day""week""month""year"
curl -i -X GET \
  'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/water?breakdown=device&continuationToken=string&current=hour&device.id=string&interval=2%20hours&previous=hour&since=2022-01-01T00%3A00%3A00Z&space.id=string&timezone=Europe%2FLondon&until=2022-01-01T00%3A00%3A00Z' \
  -H 'Authorization: Bearer <YOUR_Bearer_HERE>'

Responses

OK

Bodyapplication/jsonArray [
idstring
Example: "1234-abcd-5678-efgh"
namestring
Example: "Test Event"
dataobject
Example: {"test":true}
timestampinteger
Example: 1631707200000
]
Response
application/json
[ { "id": "1234-abcd-5678-efgh", "name": "Test Event", "data": {}, "timestamp": 1631707200000 } ]

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