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
| Name | Description |
|---|---|
| serial | Device serial code |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| startAt | Unix timestamp(ms) | true | Start time for data retrieval |
| endAt | Unix timestamp(ms) | true | End time for data retrieval |
| customerCode | String | false | Customer code |
Example Request
GET /ext/v1/devices/{serial}/locations?startAt=1738655274000&endAt=1738655274000
Authorization: Bearer token
Response
Response Body
| Name | Type | Not-null | Description |
|---|---|---|---|
| items | Array | true | List of measurements |
| time | Unix timestamp(ms) | true | Measurement time |
| latitude | Number | false | latitude value |
| longitude | Number | false | longitude value |
| battery | Number | false | Battery 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"
}