GET api/v1/devices/{deviceId}/location?sortOrder={sortOrder}&startDate={startDate}&endDate={endDate}

Get the devices location history.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
deviceId

globally unique identifier

Required

sortOrder

SortOrder

Default value is Asc

startDate

string

None.

endDate

Leave empty for all locations upto the current time.

string

None.

Body Parameters

None.

Response Information

Resource Description

DeviceLocationHistoryDto
NameDescriptionTypeAdditional information
History

Collection of LocationHistoryDto

None.

Summary

LocationHistorySummary

None.

Response Formats

application/json, text/json, application/senml+json

Sample:
{
  "History": [
    {
      "Id": "5c425b70-7d46-4e34-83e2-2f3dc00e4535",
      "Name": "sample string 2",
      "Latitude": 3.1,
      "Longitude": 4.1,
      "Elevation": 5.1,
      "WellKnownLocationId": "d796fe6d-5441-4339-8db2-0aecac3ac17f",
      "Date": "2024-12-29T17:42:12.9256412+00:00",
      "TimeAtLocationSeconds": 1,
      "DistanceTraveledMeters": 6.1
    },
    {
      "Id": "5c425b70-7d46-4e34-83e2-2f3dc00e4535",
      "Name": "sample string 2",
      "Latitude": 3.1,
      "Longitude": 4.1,
      "Elevation": 5.1,
      "WellKnownLocationId": "d796fe6d-5441-4339-8db2-0aecac3ac17f",
      "Date": "2024-12-29T17:42:12.9256412+00:00",
      "TimeAtLocationSeconds": 1,
      "DistanceTraveledMeters": 6.1
    }
  ],
  "Summary": {
    "TotalTimeSeconds": 1,
    "TotalDistanceMeters": 2.1
  }
}

application/xml, text/xml

Sample:
<DeviceLocationHistoryDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AnalysisUK.Tinamous.www.ApiControllers.Models.DeviceLocation">
  <History>
    <LocationHistoryDto>
      <Date>2024-12-29T17:42:12.9256412+00:00</Date>
      <DistanceTraveledMeters>6.1</DistanceTraveledMeters>
      <Elevation>5.1</Elevation>
      <Id>5c425b70-7d46-4e34-83e2-2f3dc00e4535</Id>
      <Latitude>3.1</Latitude>
      <Longitude>4.1</Longitude>
      <Name>sample string 2</Name>
      <TimeAtLocationSeconds>1</TimeAtLocationSeconds>
      <WellKnownLocationId>d796fe6d-5441-4339-8db2-0aecac3ac17f</WellKnownLocationId>
    </LocationHistoryDto>
    <LocationHistoryDto>
      <Date>2024-12-29T17:42:12.9256412+00:00</Date>
      <DistanceTraveledMeters>6.1</DistanceTraveledMeters>
      <Elevation>5.1</Elevation>
      <Id>5c425b70-7d46-4e34-83e2-2f3dc00e4535</Id>
      <Latitude>3.1</Latitude>
      <Longitude>4.1</Longitude>
      <Name>sample string 2</Name>
      <TimeAtLocationSeconds>1</TimeAtLocationSeconds>
      <WellKnownLocationId>d796fe6d-5441-4339-8db2-0aecac3ac17f</WellKnownLocationId>
    </LocationHistoryDto>
  </History>
  <Summary>
    <TotalDistanceMeters>2.1</TotalDistanceMeters>
    <TotalTimeSeconds>1</TotalTimeSeconds>
  </Summary>
</DeviceLocationHistoryDto>