특정기간내 운송수단의 마지막 측정값 조회
설정한 특정기간 내 운송수단이 운행을 했을 경우 해당 기간 내 운송수단의 마지막 측정값을 조회합니다.
만약 해당 기간 내 차량이 운행중이지 않았다면, 측정데이터는 조회되지 않습니다.
startAt, endAt 파라미터를 설정하지 않을 경우, 요청 시간 기준으로 최근 24시간 이내의 데이터를 조회합니다.
기간은 최대 24시간 까지 설정할 수 있습니다.
Request
GET https://openapi.willog.io/hub/v1/vehicles/latest-measurements
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | Number | false | 페이지 번호, default: 1 |
| size | Number | false | 데이터 갯수, default: 500, max: 500 |
| vehicleStatus | String | false | 운송수단 상태 |
| measurementTypes | Array | true | 측정 데이터 타입 |
| startAt | Unix timestamp(ms) | false | 조회 범위 시작 시간 |
| endAt | Unix timestamp(ms) | false | 조회 범위 마지막 시간 |
Vehicle Statuses
| Name | Description |
|---|---|
| IDLE | 미운행 |
| DRIVING | 운행중 |
Measurement Types
| Name | Description |
|---|---|
| TEMPERATURE | 온도 |
| 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 | 반환되는 배열 데이터 |
| items[].identifier | String | true | 운송수단 식별자 |
| items[].identifierType | String | true | 운송수단 식별자 타입 |
| items[].vehicleStatus | String | true | 운송수단 상태 |
| items[].latestMeasurements | Array | true | 매핑된 디바이스가 측정한 마지막 데이터 |
| items[].latestMeasurements[].serial | String | true | 디바이스 시리얼 |
| items[].latestMeasurements[].time | Unix Timestamp(ms) | true | 데이터를 측정한 시간 |
| items[].latestMeasurements[].temperature | Number | false | 온도 데이터 |
| items[].latestMeasurements[].humidity | Number | false | 습도 데이터 |
| pagination | Object | true | 페이지네이션 메타 데이터 |
| pagination.page | Number | true | 요청 페이지 번호 |
| pagination.totalPages | Number | true | 전체 페이지 수 |
| pagination.size | Number | true | 요청 데이터 갯수 |
| pagination.total | Number | true | 전체 데이터 갯수 |
identifier Types
| Name | Description |
|---|---|
| CAR_LICENSE_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
- 유효하지 않은 토큰 및 인증키
HTTP/1.1 400 Bad Request
{
"code": "A0010"
}