Read measurements
By default, returns a sensor's most recent 64 measurements sorted ascendingly by creation_timestamp
. You can use the creation_timestamp
and direction
parameters to page through the collection.
If aggregate
is set to true
, other query parameters are ignored and the request returns an aggregation of the sensor's measurements over the last 4 weeks.
Path parameters
-
Format should match the following pattern:
^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
. -
Format should match the following pattern:
^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
.
Query parameters
-
direction string
The direction of the page based on the cursor. If no cursor is provided,
next
returns the first page andprevious
returns the last page.Values are
next
orprevious
. Default value isnext
. -
creation_timestamp number
The cursor of the query. Depending on the direction, the request returns the next or previous elements. The element the cursor references is not included in the response.
-
aggregate boolean
Whether to aggregate the measurements. If
true
, ignores other query parameters and returns the 1-hour averages over the last 4 weeks for each available attribute.Default value is
false
.
Responses
-
OK
-
Bad Request
-
Unauthorized
-
Forbidden
-
Not Found
curl \
-X GET https://example.com/networks/575a7328-4e2e-4b88-afcc-e0b5ed3920cc/sensors/575a7328-4e2e-4b88-afcc-e0b5ed3920cc/measurements \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
{
"creation_timestamp": 1683644400.0,
"value": {
"temperature": 23.1,
"humidity": 0.62
},
"revision": 42
}
]
{
"temperature": [
{
"bucket_timestamp": 1683644400.0,
"average": 23.1
}
]
}
[
{
"creation_timestamp": 1683644400.0,
"value": {
"humidity": 0.62,
"temperature": 23.1
},
"revision": 42
}
]
{
"temperature": [
{
"average": 23.1,
"bucket_timestamp": 1683644400.0
}
]
}