Save Delivery Trucks
An API that registers new delivery trucks or updates existing ones based on the vehicle number.
- If the vehicle number already exists:
- The data for the corresponding vehicle number will be updated with the provided data.
- If the vehicle number does not exist:
- A new delivery truck will be registered with the given vehicle number.
To remove specific data from an existing vehicle, send a null value for the data field you want to remove.
Conversely, to retain specific data, you must include that data in full in the request.
If the same vehicle number is included more than once in a request, all entries with that vehicle number will fail.
Request
PUT https://openapi.willog.io/hub/v1/delivery-trucks
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| vehicles | Array | true | List of vehicle data (max: 200) |
| vehicles[].identifier | String | true | Vehicle number |
| vehicles[].assetCode | String | false | Asset code |
| vehicles[].driverName | String | false | Driver name |
| vehicles[].groupName | String | false | Group name (center name) |
| vehicles[].weightKg | Number | false | Weight in kg (min: 0) |
| vehicles[].memo | String | false | Memo (remarks) |
Example Request
PUT /hub/v1/delivery-trucks
Authorization: Bearer apiKey
{
"vehicles": [
{
"identifier": "12AD3456",
"assetCode": "ABCD-1234",
"weightKg": 1000,
"memo": null,
"driverName": null,
"groupName": null
},
{
"identifier": "09W8765",
"assetCode": "EFGH-5678",
"weightKg": 3000,
"memo": "Weekend delivery vehicle",
"driverName": null,
"groupName": null
}
]
}
Response
Response Body
| Name | Type | Not-null | Description |
|---|---|---|---|
| items | Array | true | Array of response data |
| items[].resultCode | String | true | Delivery truck save result |
| items[].identifier | String | true | Vehicle number |
| items[].identifierType | String | true | Vehicle identifier type |
| items[].assetCode | String | false | Asset code |
ResultCode
| Name | Description |
|---|---|
| SUCCESS | Success |
| DUPLICATE_REQUEST_IDENTIFIER | Failed (same vehicle number included more than once in the request) |
Identifier Types
| Name | Description |
|---|---|
| CAR_LICENSE_NUMBER | License plate number |
Example Response
HTTP/1.1 200 OK
{
"items": [
{
"resultCode": "SUCCESS",
"identifier": "12AD3456",
"assetCode": "ABCD-1234",
"identifierType": "CAR_LICENSE_NUMBER"
},
{
"resultCode": "DUPLICATE_REQUEST_IDENTIFIER",
"identifier": "34W5678",
"assetCode": "ABCD-5678",
"identifierType": "CAR_LICENSE_NUMBER"
},
{
"resultCode": "DUPLICATE_REQUEST_IDENTIFIER",
"identifier": "34W5678",
"assetCode": "EFGH-1234",
"identifierType": "CAR_LICENSE_NUMBER"
}
]
}
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"
}
- Server Error
HTTP/1.1 500 Internal Server Error
{
"code": "OA-9999"
}