# Wia REST API reference
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. Version: v1 ## Servers Production ``` https://api.wia.io/v1 ``` ## Security ### ApplicationKey An Application key for read only access Type: http Scheme: bearer Bearer Format: Bearer ## Download OpenAPI description [Wia REST API reference](https://docs.wia.io/_spec/apis/Wia%20REST%20API/docs.yaml) ## 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. ### Retrieves a list of alerts in a Space - [GET /alerts](https://docs.wia.io/apis/wia-rest-api/docs/alert/paths/~1alerts/get.md): Retrieves a list of alerts in a Space ### Retrieves an alert - [GET /alerts/{id}](https://docs.wia.io/apis/wia-rest-api/docs/alert/paths/~1alerts~1%7Bid%7D/get.md): Retrieves an alert ### Update the resolution status of an alert - [PUT /alerts/{id}/resolve](https://docs.wia.io/apis/wia-rest-api/docs/alert/paths/~1alerts~1%7Bid%7D~1resolve/put.md): Update the resolution status of an alert ## 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. ### Retrieves a list of devices in a Model e.g. Device - [GET /devices](https://docs.wia.io/apis/wia-rest-api/docs/device/paths/~1devices/get.md): Retrieves a list of devices in a Model e.g. Device, Gateway, Flow, Workplace, Space, Organisation, Product, User, etc. ### Retrieve a Device - [GET /devices/{id}](https://docs.wia.io/apis/wia-rest-api/docs/device/paths/~1devices~1%7Bid%7D/get.md): Retrieve a Device ## 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. ### The API endpoint retrieves electricity consumption - [GET /energy/electricity](https://docs.wia.io/apis/wia-rest-api/docs/energy/paths/~1energy~1electricity/get.md): 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. ### The API endpoint retrieves Gas consumption data in - [GET /energy/gas](https://docs.wia.io/apis/wia-rest-api/docs/energy/paths/~1energy~1gas/get.md): 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. ### The API endpoint retrieves Water consumption data - [GET /energy/water](https://docs.wia.io/apis/wia-rest-api/docs/energy/paths/~1energy~1water/get.md): 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. ## 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. ### List Gateways - [GET /gateways/](https://docs.wia.io/apis/wia-rest-api/docs/gateway/paths/~1gateways~1/get.md): List Gateways ### Retrieve a Gateway - [GET /gateways/{id}](https://docs.wia.io/apis/wia-rest-api/docs/gateway/paths/~1gateways~1%7Bid%7D/get.md): Retrieve a Gateway ## Space Spaces are physical locations that are monitored by the Wia platform and house all devices and gateways that represent that location. ### Retrieve list of all Spaces - [GET /spaces](https://docs.wia.io/apis/wia-rest-api/docs/space/paths/~1spaces/get.md): Retrieve list of all Spaces ### Retrieve a Space - [GET /spaces/{id}](https://docs.wia.io/apis/wia-rest-api/docs/space/paths/~1spaces~1%7Bid%7D/get.md): Retrieve a Space