Introduction
Technical documentation
Getting started
This documentation describes how energy data can be retrieved form the api.I tdescribes the resources types it will return bu also how the are correlated to oneanother. Also the authorisation is handled.
Resource types
The three resource types in the api are :
- Eancode metadata
- Measuring channel
- Values data
The hierarchical relationship is that a eancode can have multiple channels and each channel can hold multiple consuptions.
API Key
You need to have an authorization key in every request in order to communicate with the API. The key will determine the scope of the eancodes that you can access.
If not have one request one by contacting INNAX.
Authorization
Attach an Authorization header to every request. The value should be "Bearer <your auth key>"
In C# you would set it up like this:
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "auth key");
In javascript
$.ajax({
url: 'https://<url host>/measurements/eancodes/',
type: 'GET',
contentType: 'application/json'
headers: {
'Authorization': 'Bearer <auth key>'
},
success: function (result) {
// CallBack(result);
},
error: function (error) {
}
});
Endpoints
| Models | Url |
|---|---|
| EanCodes List | [<host url>/measurements/eancodes] |
| One EanCode | [<host url>/measurements/eancodes/<ean code>] |
| Channels List | [<host url>/measurements/eancodes/<ean code>/channels] |
| One Channel | [<host url>/measurements/eancodes/<ean code>/channels/<channel id>] |
| Values List | [<host url>/measurements/eancodes/<ean code>/values] |
Examples
Get accessable eancodes:
curl -X 'GET' \
'https://<url host>/measurements/EanCodes' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxx'
Output(A list of eancodes):
[
"871234567890123456",
"871234567890123457",
"871234567890123458"
]
Get eancode details:
curl -X 'GET' \
'https://<url host>/measurements/EanCodes/871234567890123456' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer xxxxxxxxx'
Output (Eancode resourcetype):
{
"eanCode": "871234567890123456",
"meterSerialNumber": "1234567890",
"type": "ELK",
"connectionType": "TM",
"contractedPower": 100,
"status": "IBD",
"channelIds": [
5
]
}
Get channel metadata:
curl -X 'GET' \
'https://<url host>/measurements/EanCodes/871234567890123456/channels' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer xxxxxxxxx'
Output( list of resource type channel):
[
{
"id": 5,
"description": "Hoofdmeting",
"type": "Hoofdmeting elk",
"typeOfMetering": "Reading",
"interval": 15,
"ratio": 121.55999999999999,
"unit": "kWh",
"evhiCorrected": true
},
{
"id": 66666666,
"description": "Hoofdmeting",
"type": "Hoofdmeting",
"typeOfMetering": "Reading",
"interval": 15,
"ratio": 121.55999999999999,
"unit": "kVarh",
"evhiCorrected": true
}
}
Get consumption data of eancode values:
In this call you can select the start and end dates for values. Default values are taken for the last day.
Specific Queries:
- StartPeriod in the format: 'yyyy-mm-ddThh:mm:ss'
- EndPeriod in the format: 'yyyy-mm-ddThh:mm:ss'
- Channel id
curl -X 'GET' \
'<host url>/measurements/EanCodes/<ean code>/values?StartPeriod=2022-07-23T14%3A45%3A00' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer xxxxxxxxx'
You can also filter energy reading per channel of ean by including the channel id in the url
'<host url>/measurements/EanCodes/<ean code>/values?channelid=<channel id>
Ouput(List<value>):
[
{
"periodStart": "2022-07-26T17:15:00",
"periodEnd": "2022-07-26T17:30:00",
"startReading": 16.63524,
"endReading": 22.5595999999,
"value": 15.924359999946319,
"status": null,
"periodEndLocalTime": "2022-07-26T19:30:00",
"channelId": 5
},
{
"periodStart": "2022-07-26T17:30:00",
"periodEnd": "2022-07-26T17:45:00",
"startReading": 22.5595999999,
"endReading": 36.2133199999,
"value": 16.65371999994386,
"status": null,
"periodEndLocalTime": "2022-07-26T19:45:00",
"channelId": 33
}
}

