This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Telemetry Messages
sushilraje edited this page Jan 23, 2019
·
1 revision
This api retrieves telemetry messages for devices with optional parameters below to limit the number of results.
- Visibility: public
- Authentication: requires Viewer|Admin
Request:
GET /v1/messages?from={time}&to={time}&order={order}&skip={count}&limit={count}&devices={list of IDs}
Query parameters:
Name | Type | Example | Description |
---|---|---|---|
from | datetime* | NOW-PT24H | The start of the time window for the query. ISO8601 format or "NOW-{ISO 8601 duration}" |
to | datetime* | NOW | The end of the time window for the query. ISO8601 format or "NOW-{ISO 8601 duration}" |
order | string | desc | Whether to sort the result from the oldest (asc) or the most recent (desc) |
skip | int | 0 | How many records to skip, used to paginate through the global list of alerts |
limit | int | 50 | How many records to return, used to paginate through the global list of alerts |
devices | list* | id1,id6,xyz | A filter used to request alerts for specific devices |
Example:
GET /v1/messages?from=2017-01-14T00:00:00+00:00&to=2017-01-16T00:00:00+00:00
Response:
200 OK
Content-Type: application/json; charset=utf-8
{
"Items": [
{
"DeviceId": "Elevator1",
"Time": "2017-01-14T05:39:45+00:00",
"Data": {
"current_floor": 7
}
},
{
"DeviceId": "Room44",
"Time": "2017-01-14T11:13:04+00:00",
"Data": {
"temperature" : 53,
"t_unit" : "F",
"humidity" : 53
}
},
{
"DeviceId": "Car89",
"Time": "2017-01-15T19:04:25+00:00",
"Data": {
"temperature" : 82,
"t_unit" : "F",
"latitude" : 47.601010,
"longitude": -122.164454
}
}
],
"Properties": [
"current_floor",
"temperature",
"t_unit",
"humidity",
"latitude",
"longitude"
],
"$metadata": {
"$type": "MessageList;v1",
"$uri": "/v1/messages"
}
}