Skip to main content

Retrieve Measurement Data

This endpoint returns the time-series measurement data recorded by a device during shipment — temperature, humidity, acceleration, tilt, light exposure, and so on. Use the measurementTypes query parameter to narrow the response to only the types you need. The response also includes the most recent battery reading from the same date range, so a single call gives you both the sensor readings and the device's current power status.

For non-real-time devices, measurement data is only available after shipment completion (i.e., after the device has been collected and its readings uploaded).

Constraints

  • The query window (startAtendAt) must not exceed 5 days.
  • startAt must be less than or equal to endAt.
  • Battery information is best-effort — if no battery measurement was recorded in the requested window, battery is returned as null.
  • If the requested endAt is before the device was registered, the request is rejected with T0118.

Request


GET https://openapi.willog.io/ext/v2/devices/{serial}/measurements

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
measurementTypesArraytrueTypes of measurements to retrieve

Measurement Types

NameDescription
TEMPERATURETemperature
HUMIDITYHumidity
ACCAcceleration
ACCXAcceleration X-axis
ACCYAcceleration Y-axis
ACCZAcceleration Z-axis
TILTXTilt X-axis
TILTYTilt Y-axis
TILTZTilt Z-axis
EXPLight Exposure(Lux)

Example Request

GET /ext/v2/devices/{serial}/measurements?startAt=1738655274000&endAt=1738655274000&measurementTypes=TEMPERATURE&measurementTypes=HUMIDITY
Authorization: Bearer token

Response


Response Body

NameTypeNot-nullDescription
itemsArraytrueList of measurements
timeUnix timestamp(ms)trueMeasurement time
temperatureNumberfalseTemperature value
humidityNumberfalseHumidity value
accNumberfalseAcceleration value
accxNumberfalseAcceleration X-axis
accyNumberfalseAcceleration Y-axis
acczNumberfalseAcceleration Z-axis
tiltxNumberfalseTilt X-axis
tiltyNumberfalseTilt Y-axis
tiltzNumberfalseTilt Z-axis
batteryObjectfalseLatest battery info (null if unknown)
battery.timeUnix timestamp(ms)falseTime the battery level was recorded
battery.percentNumberfalseBattery level (0–100)

Example Response

HTTP/1.1 200 OK

{
"items": [
{
"time": 1738655274000,
"temperature": 36.5,
"humidity": 56
}
],
"battery": {
"time": 1738655274000,
"percent": 81
}
}

When the device has no recorded battery measurement in the requested range, battery is null:

{
"items": [ ... ],
"battery": null
}

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

- Device Did Not Exist in Requested Date Range

HTTP/1.1 400 Bad Request

{
"code": "T0118"
}

- Invalid Date Range

HTTP/1.1 400 Bad Request

{
"code": "E0004"
}

- From Date Greater Than To Date

HTTP/1.1 400 Bad Request

{
"code": "E0022"
}