Skip to main content

Retrieve Location Data

This endpoint allows you to fetch location data recorded during shipment.

Note:

  • Location data can be retrieved for a maximum period of 5 days.
  • Battery level may not be provided depending on the device.

Request


GET https://openapi.willog.io/ext/v1/devices/{serial}/locations

Path Variable

NameDescription
serialDevice serial code

Query Parameters

NameTypeRequiredDescription
startAtUnix timestamp(ms)trueStart time for data retrieval
endAtUnix timestamp(ms)trueEnd time for data retrieval
customerCodeStringfalseCustomer code

Example Request

GET /ext/v1/devices/{serial}/locations?startAt=1738655274000&endAt=1738655274000
Authorization: Bearer token

Response


Response Body

NameTypeNot-nullDescription
itemsArraytrueList of measurements
timeUnix timestamp(ms)trueMeasurement time
latitudeNumberfalselatitude value
longitudeNumberfalselongitude value
batteryNumberfalseBattery level (Optional)

Example Response

HTTP/1.1 200 OK

{
"items": [
{
"latitude": 37.253781,
"longitude": 127.103773,
"time": 1719817200000,
},
{
"latitude": 37.253781,
"longitude": 127.103773,
"time": 1719817200000,
}
]
}

Error Responses

- Unauthorized Access to Customer Data

HTTP/1.1 400 Bad Request

{
"code": "A0016"
}

- Unregistered Device

HTTP/1.1 400 Bad Request

{
"code": "T0007"
}

- Invalid Date Range

HTTP/1.1 400 Bad Request

{
"code": "E0004"
}