Measurements
Read Last
Read last measurement(s) | ||
type | object | |
properties | ||
| The device unique identifier. Device Unique ID / Device External key | |
type | string (UUID) / string | |
| The parent unique identifier. Product Unique ID / Location Unique ID / Device Unique ID | |
type | string (UUID) | |
Response
type | array | ||
items | type | object | |
properties | |||
| Product Unique ID and Metric External key | ||
type | string | ||
pattern | product_uid:external_key | ||
| Measurement value | ||
type | boolean / number / object (Location) / object / string | ||
| Measurement aggregation | ||
enum | derivative.1s, derivative.1m, derivative.1h, last | ||
| The device unique identifier. Device Unique ID | ||
type | string (UUID) | ||
| Measurement date/time | ||
type | number (Unix time) | ||
Notes
Request device and entity are mutually exclusive.
Response timestamp is in decimal seconds with millisecond precision.
Example request
GET https://interay.io/api/v1/measurements/read/last?device=00000000-0000-0000-0000-000000000000
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Example response
200 OK
Content-Type: application/json
[
{
"metric": "99999999-9999-9999-9999-999999999999:temperature",
"value": 1.0,
"aggregated": "last",
"entity": "00000000-0000-0000-0000-000000000000",
"timestamp": 1767222000.001
},
{
"metric": "99999999-9999-9999-9999-999999999999:state",
"value": "ok",
"aggregated": "last",
"entity": "00000000-0000-0000-0000-000000000000",
"timestamp": 1767222000.001
}
]
Read History
Read measurement(s) | |||
type | object | ||
properties | |||
| type | array | |
items | The device unique identifier. Device Unique ID / Device External key | ||
type | string (UUID) / string | ||
| type | array | |
items | The parent unique identifier. Product Unique ID / Location Unique ID / Device Unique ID | ||
type | string (UUID) | ||
| type | array | |
items | Metric External key | ||
type | string | ||
| The beginning of the queried time range | ||
type | number (Unix time) / string (Duration) / string (ISO 8601) | ||
| The end of the queried time range | ||
type | number (Unix time) / string (Duration) / string (ISO 8601) | ||
| The period of aggregated data | ||
type | number (seconds) / string (Duration) | ||
Response
type | array | ||
items | type | object | |
properties | |||
| Product Unique ID and Metric External key | ||
type | string | ||
pattern | product_uid:external_key | ||
| Measurement value | ||
type | boolean / number / object (Location) / object / string | ||
| Measurement aggregation | ||
enum | derivative.1s, derivative.1m, derivative.1h, last, max, mean, min | ||
| The device unique identifier. Device Unique ID | ||
type | string (UUID) | ||
| Measurement date/time | ||
type | number (Unix time) | ||
Notes
Request devices and entities are mutually exclusive.
Request timeRangeStart and timeRangeStop should have a negative Duration.
Response timestamp is in decimal seconds with millisecond precision.
Example request
GET https://interay.io/api/v1/measurements/read?devices=00000000-0000-0000-0000-000000000000&timeRangeStart=-1d
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Example response
200 OK
Content-Type: application/json
[
{
"metric": "99999999-9999-9999-9999-999999999999:temperature",
"value": 1.0,
"aggregated": "last",
"entity": "00000000-0000-0000-0000-000000000000",
"timestamp": 1767222000.001
},
{
"metric": "99999999-9999-9999-9999-999999999999:state",
"value": "ok",
"aggregated": "last",
"entity": "00000000-0000-0000-0000-000000000000",
"timestamp": 1767222000.001
}
]
Write
Write measurement(s) | ||||
type | object | |||
properties | ||||
| The device unique identifier. Device Unique ID / Device External key | |||
type | string (UUID) / string | |||
| The device measurement(s) | |||
type | array | |||
items | type | object | ||
properties | ||||
| Metric External key | |||
type | string | |||
| Measurement value | |||
type | boolean / number / object (Location) / object / string | |||
| Measurement date/time | |||
type | number (Unix time) / string (ISO 8601) | |||
default | Server’s current time | |||
Example request
POST https://interay.io/api/v1/measurements/write
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json
{
"device": "00000000-0000-0000-0000-000000000000",
"measurements": [
{
"metric": "temperature",
"value": 1.0,
"timestamp": "2019-09-26T07:58:30.996+0200",
},
{
"metric": "state",
"value": "ok",
"timestamp": "2019-09-26T07:58:30.996+0200",
}
]
}
Example response
200 OK