GetLocationHistory
Get location history for one, all, or a group of devices specified by tags parameter.
Notes:
- Location history data expires after ~6 months (27 weeks)
- The serviceType field is intentionally empty for location data before December 10th 2021
Basic Request for device history:
curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID&start=2022-10-15T06:00:00.000Z&end=2022-10-16T18:30:00.000Z" -H "Authorization: Bearer $API_KEY"
Paginated Request:
export PAGE_NEXT_TOKEN=$(curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID&start=2022-10-15T06:00:00.000Z&end=2022-10-16T18:30:00.000Z" -H "Authorization: Bearer $API_KEY" | jq .pageNextToken)
curl -G $API_HOST/v1/location/history -d "deviceId=$DEVICE_ID" --data-urlencode "pageNextToken=$PAGE_NEXT_TOKEN" -H "Authorization: Bearer $API_KEY"
Request all devices location history†:
curl -G $API_HOST/v1/location/history -H "Authorization: Bearer $API_KEY"
Request all devices last known location†:
curl -G $API_HOST/v1/location/history -d "latest=true" -H "Authorization: Bearer $API_KEY"
† Requires admin privileges
Query parameters
This is the canonical device id used in the device certificate, and as the MQTT client id.
This is the canonical device id that is an optional parameter. Specify a device id to get its location history. If a device id is not provided, location history for all devices are returned. You must have admin privileges to perform this operation.
Get the last known location for all devices or a single device (if deviceId is supplied). You must have admin privileges.
Sorting order for the paginated results => desc (descending; default) or asc (ascending).
HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
Maximum number of items you want returned in the response (<=100).
If available in the initial response, use this token to retrieve the next page of items in the list. When supplying as a request parameter, use URL-encoding.
This is the canonical device id used in the device certificate, and as the MQTT client id.
HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
HTML-encoded ISO-8601 date-time string denoting the start or end of a date range. If the string includes only a date, the time is the beginning of the day (00:00:00).
If specified, only return location history for devices that have one of these Device Groups (tags). You must have admin privileges.
Response
Contains JSON response
Example response
{
"items": [
{
"id": "bc631093-7f7c-4c1b-aa63-a68c759bcd5c",
"deviceId": "nrf-1234567890123456789000",
"insertedAt": "2020-06-25T21:05:12.830Z",
"recordedAt": "2020-06-25T21:05:12.830Z",
"lat": "45.524098",
"lon": "-122.688408",
"meta": {
"acc": 233.44,
"spd": 11.22,
"hdg": 76.8,
"alt": 12
},
"uncertainty": "934"
}
],
"total": 10,
"pageNextToken": "4bb1f9ab35bd"
}Changes
No recorded changes to this endpoint across all 1 revision of this API.