Skip to main content

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.

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

NameTypeRequiredDescription
pageNumberfalsePage number, default: 1
sizeNumberfalseNumber of records, default: 500, max: 500
vehicleStatusStringfalseVehicle status
measurementTypeStringtrueMeasurement data type
startAtUnix timestamp(ms)trueStart time of the query range
endAtUnix timestamp(ms)trueEnd time of the query range

Vehicle Statuses

NameDescription
IDLENot in use
DRIVINGIn operation

Measurement Types

NameDescription
TEMPERATURETemperature
HUMIDITYHumidity

Example Request

GET /hub/v1/vehicles/latest-measurements?page=1&size=300&vehicleStatus=DRIVING&measurementType=TEMPERATURE&startAt=1738655274000&endAt=1738741674000
Authorization: Bearer apiKey

Response


Response Body

NameTypeNot-nullDescription
itemsArraytrueArray of response data
items[].identifierStringtrueVehicle identifier
items[].identifierTypeStringtrueVehicle identifier type
items[].vehicleStatusStringtrueVehicle status
items[].latestMeasurementsArraytrueLatest measurements from mapped devices
items[].latestMeasurements[].serialStringtrueDevice serial number
items[].latestMeasurements[].timeUnix Timestamp(ms)trueMeasurement timestamp
items[].latestMeasurements[].temperatureNumberfalseTemperature data
items[].latestMeasurements[].humidityNumberfalseHumidity data
paginationObjecttruePagination metadata
pagination.pageNumbertrueRequested page number
pagination.totalPagesNumbertrueTotal page count
pagination.sizeNumbertrueRequested number of records
pagination.totalNumbertrueTotal record count

Identifier Types

NameDescription
CAR_LICENSE_NUMBERLicense 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"
}