Get Latest Vehicle Measurements Within Time Range
Retrieves the most recent measurement data for vehicles that were active during a specified time period.
If a vehicle was not in operation during the specified period, no measurement data will be returned.
If the startAt and endAt parameters are not specified, data from the last 24 hours based on the request time will be retrieved.
The time range can be set up to a maximum of 24 hours.
Request
GET https://openapi.willog.io/hub/v1/vehicles/latest-measurements
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | Number | false | Page number, default: 1 |
| size | Number | false | Number of records, default: 500, max: 500 |
| vehicleStatus | String | false | Vehicle status |
| measurementTypes | Array | true | Measurement data type |
| startAt | Unix timestamp(ms) | false | Start time of the query range |
| endAt | Unix timestamp(ms) | false | End time of the query range |
Vehicle Statuses
| Name | Description |
|---|---|
| IDLE | Not in use |
| DRIVING | In operation |
Measurement Types
| Name | Description |
|---|---|
| TEMPERATURE | Temperature |
| HUMIDITY | Humidity |
Example Request
GET /hub/v1/vehicles/latest-measurements?page=1&size=300&vehicleStatus=DRIVING&measurementTypes=TEMPERATURE&startAt=1738655274000&endAt=1738741674000
Authorization: Bearer apiKey
Response
Response Body
| Name | Type | Not-null | Description |
|---|---|---|---|
| items | Array | true | Array of response data |
| items[].identifier | String | true | Vehicle identifier |
| items[].identifierType | String | true | Vehicle identifier type |
| items[].vehicleStatus | String | true | Vehicle status |
| items[].latestMeasurements | Array | true | Latest measurements from mapped devices |
| items[].latestMeasurements[].serial | String | true | Device serial number |
| items[].latestMeasurements[].time | Unix Timestamp(ms) | true | Measurement timestamp |
| items[].latestMeasurements[].temperature | Number | false | Temperature data |
| items[].latestMeasurements[].humidity | Number | false | Humidity data |
| pagination | Object | true | Pagination metadata |
| pagination.page | Number | true | Requested page number |
| pagination.totalPages | Number | true | Total page count |
| pagination.size | Number | true | Requested number of records |
| pagination.total | Number | true | Total record count |
Identifier Types
| Name | Description |
|---|---|
| CAR_LICENSE_NUMBER | License plate number |
Example Response
HTTP/1.1 200 OK
{
"items": [
{
"identifier": "vehicle-001",
"identifierType": "CAR_LICENSE_NUMBER",
"vehicleStatus": "DRIVING",
"latestMeasurements": [
{
"serial": "device-serial-1",
"time": 1738741600000,
"temperature": 36.5,
"humidity": 55
},
{
"serial": "device-serial-2",
"time": 1738741600000,
"temperature": null,
"humidity": 60
}
]
},
{
"identifier": "vehicle-002",
"identifierType": "CAR_LICENSE_NUMBER",
"vehicleStatus": "IDLE",
"latestMeasurements": []
}
],
"pagination": {
"page": 1,
"size": 100,
"total": 2,
"totalPages": 1
}
}
Error Responses
- Invalid Token or API Key
HTTP/1.1 400 Bad Request
{
"code": "A0010"
}
- Invalid Request Parameters
HTTP/1.1 400 Bad Request
{
"code": "E0021"
}