Get Location History

POST {{base_url}}/api/location/history

Description

This API retrieves the location history of a device or all devices within a specified time range. The results can be paginated, limited, and sorted.

Request Parameters

  • deviceId (string, optional):
    The MAC address of the device whose location history you want to retrieve. If not provided, the API will return the location history for all devices.

  • fromDate (number, optional):
    The start timestamp (in milliseconds since epoch) for the location history retrieval.

    • If not provided:

      • If fromDate is provided, toDate will default to 23:59:59 of the same day.
      • If fromDate is not provided, it defaults to the end of today
    • Note: The time range between fromDate and toDate cannot exceed 24 hours.

  • fromId (string, optional):
    The ID of the last object retrieved from the previous request, used for paginated fetching. This allows fetching newer set of records after this ID.

  • limit (number, optional, default: 10):
    The maximum number of records to return per device in the response.

  • skip (number, optional, default: 0):
    The number of records to skip before starting to return results.

  • sort (string, optional, default: desc):
    Defines the sorting order of the results.

    • asc: Sorts records in ascending order (from oldest to newest).
    • desc: Sorts records in descending order (from newest to oldest).

Request Body

{"deviceId"=>"Device MAC Address", "fromDate"=>1726066899000, "toDate"=>1726218000000, "id"=>"Last object ID", "limit"=>1, "skip"=>0, "sort"=>"asc or desc"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring