Make your first API call

The UMeter API lets you connect to the system to get raw meter readings and total numbers of your consumption without any difference if readings were taken from a regular smart meter, solar inverter or any other custom meter. In this guide, we will show you how to connect as a user and make your first API call by fetching the user details and usage.

Prerequisites

To start with API you will need to use your credentials(email and password) to get a token that will be used for the next calls.
This guide focuses on server side integration with our API, which is what we recommend to most of our customers. If you wish to integrate the client side, reach out and we can help you on your way.

Step 1: Get an API access token

While this guide uses cURL for examples, you can follow along in Postman if you prefer. To obtain your access token in Postman, use these settings. We also keep an updated Postman collection.

curl https://auth.umeter.nl/token \
-X POST \
-H “Content-Type: application/json” \
-d “grant_type=password&username=your@email.com&password=your_password”

Step 2: Get user details

User details include information about the current user you logged in previously. In the response you can find some meta data, list of addresses and devices assigned to the user.

To make this request you need to include the access token recieved from the previous step. Take a look at the code below:

curl https://app.umeter.nl/api/customer \
-X GET \
-H “Authorization: Bearer {YOUR_ACCESS_TOKEN}” \
-H “Content-Type: application/json”

In the collection of addresses, you can find a connection ID. We call it EAN. Using this connection ID you will be able to get consumption information.

Step 3: Get consumption

UMeter keeps meter reading data in a special database. To access consumption information you can use the next approach.
To make this request you need to include the access token received from the previous step. Take a look at the code below:

curl https://meas.meterdata.io/api/v2/measurements/year/2022?meteringPointIds={EAN}&measKeys=import \
-X GET \
-H “Authorization: Bearer {YOUR_ACCESS_TOKEN}” \
-H “Content-Type: application/json”

You can specify the date range using the next options. To get information by 15 mins for a specific day use:

https://meas.meterdata.io/api/v2/measurements/date/20220525?meteringPointIds={EAN}&measKeys=import

where 20220525 – is a date in the format of YYYYMMDD.

To get information for a month per day use the next call:

https://meas.meterdata.io/api/v2/measurements/month/202205?meteringPointIds={EAN}&measKeys=import

where 202205 – is a date in the format of YYYYMM