Add Readings For Custom Meter
curl --request POST \
--url https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timestamp": "2020-01-02T19:00:00.000+0000",
"value": 5
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timestamp: '2020-01-02T19:00:00.000+0000', value: 5})
};
fetch('https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings"
payload = {
"timestamp": "2020-01-02T19:00:00.000+0000",
"value": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)RealTime API - Meter Readings
Add Readings For Custom Meter
A POST request will create a meter reading for the custom meter with a matching identifier.
A constraint violation error will occur if a custom meter has an existing meter reading for a given timestamp.
Timestamp Format
The timestamp must be in the ISO 8601 standard format. The following are examples of supported formats:
| Format | Example |
|---|---|
| YYYY-MM-DDTHH:mm:ss.SSSZ | 2020-01-03T09:07:21.215Z |
| YYYY-MM-DDTHH:mm:ss.SSZ | 2020-01-03T09:07:21.21Z |
| YYYY-MM-DDTHH:mm:ss.SZ | 2020-01-03T09:07:21.2Z |
| YYYY-MM-DDTHH:mm:ss.SSS | 2020-01-03T09:07:21.215 |
| YYYY-MM-DDTHH:mm:ss.SS | 2020-01-03T09:07:21.21 |
| YYYY-MM-DDTHH:mm:ssZ | 2020-01-03T09:07:21Z |
| YYYY-MM-DDTHH:mm:ss | 2020-01-03T09:07:21 |
| YYYY-MM-DDTHH:mmZ | 2020-01-03T09:07Z |
| YYYY-MM-DDTHH:mm | 2020-01-03T09:07 |
Meter Reading Value Format
The maximum allowed scale for a meter reading value is limited to 16 digits, with the precision limited to 4 digits. Any meter reading values that exceed the precision of 4 digits will be rounded and result in a loss of precision.
The input also accepts scientific notation formats such as “2.5E+8”. These values are constrained by the limitations above.
POST
/
custommeters
/
{customMeterId}
/
meterreadings
Add Readings For Custom Meter
curl --request POST \
--url https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timestamp": "2020-01-02T19:00:00.000+0000",
"value": 5
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({timestamp: '2020-01-02T19:00:00.000+0000', value: 5})
};
fetch('https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://realtime.replace-me.example.com/custommeters/{customMeterId}/meterreadings"
payload = {
"timestamp": "2020-01-02T19:00:00.000+0000",
"value": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
