Use this API resources to CRUD trucks.
This API endpoint will allow you to get a list of trucks. You can filter by using different query parameters such as license_plate or truck_driver.
Code | Description |
---|---|
400 | Bad Request. |
404 | Not Found. |
500 | Internal Server Error. |
curl "https://app.octopi.co/api/v1/trucks.json?license_plate=Octopi" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOUR TOKEN HERE"
{ "trucks": [ { "id": 123, "active": true, "display_name": "00000 (Trucking Company: ABC TRANSPORT)", "year": null, "trucking_company": { "name": "ABC TRANSPORT", "code": null, }, "truck_driver": { "fullname": "John Doe", "license_number": "ABC1234", "number": "356396" }, "created_at": "2018-05-23T16:00:26Z", "updated_at": "2020-01-27T19:24:30Z" }, { "id": 456, "active": true, "display_name": "00001 (Trucking Company: ABC TRANSPORT)", "year": null, "trucking_company": { "name": "ABC TRANSPORT", "code": null, }, "created_at": "2020-07-17T23:19:32Z", "updated_at": "2021-06-17T05:02:26Z" }, { "id": 789, "active": true, "display_name": "00002 (Trucking Company: XYZ TRANSPORT)", "year": null, "trucking_company": { "name": "XYZ TRANSPORT", "code": "IGG897", }, "created_at": "2018-04-19T22:16:54Z", "updated_at": "2021-05-14T11:03:38Z" }, ] }
Param name | Description |
---|---|
license_plate optional |
Allows you to filter/search trucks by license plate Validations:
|
trucking_company optional |
Allows you to filter/search trucks by trucking company Validations:
|
truck_driver_number optional |
Allows you to filter/search trucks by truck driver number Validations:
|
active optional |
Filter for active trucks by setting to true. Set to false to get all inactive trucks. If absent, Octopi will return both active and inactive trucks. Validations:
|
page optional |
Specify which page of results to fetch. This value defaults to 1. Validations:
|
per optional |
The number of items to be displayed. This value defaults to 10 and accepts a maximum of 100. Validations:
|
This API endpoint will allow you to create new trucks within Octopi.
Code | Description |
---|---|
400 | Bad Request. |
404 | Not Found. |
500 | Internal Server Error. |
curl --location --request POST 'https://app.octopi.co/api/v1/trucks.json' --header 'Authorization: Bearer token_value' --header 'Content-Type: application/json' --data-raw '{ "truck": { "license_plate": "ABC123", "number": "12345", "weight": 10000, "color": "#00528D", "make": "A", "model": "M", "year": 1987, "active": true } }'
{ "truck": { "id": 27095, "active": true, "license_plate": "ABC123", "number": "12345", "weight": 4535, "color": "#00528D", "is_mule": false, "allowed_until": null, "year": 1987, "make": "A", "model": "M", "created_at": "2022-06-22T09:10:16Z", "updated_at": "2022-06-22T09:10:16Z" } }
Param name | Description |
---|---|
truck required |
Truck data Validations:
|
truck[license_plate] required |
Truck license plate Validations:
|
truck[number] optional |
Truck number Validations:
|
truck[truck_driver_license_number] optional |
Truck driver’s license number Validations:
|
truck[trucking_company] optional |
Trucking company’s name Validations:
|
truck[weight] optional |
Truck weight in your organization’s weight unit preference Validations:
|
truck[active] optional |
Is the truck active? Validations:
|
truck[color] optional |
Truck color hex code Validations:
|
truck[make] optional |
Truck make Validations:
|
truck[model] optional |
Truck model Validations:
|
truck[year] optional |
Truck year Validations:
|
truck[allowed_until] optional |
Until when is this truck allowed at the terminal? Sample valid entries: ‘2022-06-02’, ‘2/6/2022’, ‘June 2, 2022’ Validations:
|
truck[is_mule] optional |
Is the truck a mule? Validations:
|
This API endpoint will allow you to edit existing trucks within Octopi.
Code | Description |
---|---|
400 | Bad Request. |
404 | Not Found. |
500 | Internal Server Error. |
curl --location --request PATCH 'https://app.octopi.co/api/v1/trucks/:truck_license_number.json' --header 'Authorization: Bearer token_value' --header 'Content-Type: application/json' --data-raw '{ "truck": { "license_plate": "TEST123", "number": "6789", "weight": 12300, "active": false } }'
{ "truck": { "id": 27095, "active": false, "license_plate": "TEST123", "number": "6789", "weight": 5579, "color": "#00528D", "is_mule": false, "allowed_until": null, "year": 1987, "make": "A", "model": "M", "created_at": "2022-06-22T09:10:16Z", "updated_at": "2022-06-22T09:12:08Z" } }
Param name | Description |
---|---|
truck_license_number required |
Truck license plate. This is the resource you will update. Validations:
|
truck required |
Truck data Validations:
|
truck[number] optional |
Truck number Validations:
|
truck[truck_driver_license_number] optional |
Truck driver’s license number Validations:
|
truck[trucking_company] optional |
Trucking company’s name Validations:
|
truck[weight] optional |
Truck weight in your organization’s weight unit preference Validations:
|
truck[active] optional |
Is the truck active? Validations:
|
truck[color] optional |
Truck color hex code Validations:
|
truck[make] optional |
Truck make Validations:
|
truck[model] optional |
Truck model Validations:
|
truck[year] optional |
Truck year Validations:
|
truck[allowed_until] optional |
Until when is this truck allowed at the terminal? Sample valid entries: ‘2022-06-02’, ‘2/6/2022’, ‘June 2, 2022’ Validations:
|
truck[is_mule] optional |
Is the truck a mule? Validations:
|
Performs completion of gate out operation for the truck
Code | Description |
---|---|
400 | Bad Request. |
404 | Not Found. |
500 | Internal Server Error. |
curl --location --request POST 'https://app.octopi.co/api/v1/trucks/:truck_license_number/gate_out.json' --header 'Authorization: Bearer token_value' --header 'Content-Type: application/json' --data-raw '{ "reason_for_incomplete": "wrong_terminal", "left_without_container": false, "container_seals": [ { "container_number": "UTIU1939201", "seal":"ZDFDGFR1" }, { "container_number": "TESU1293024", "seal":"SERERE22" } ] }'
{ "id": 179, "truck": { "id": 1, "license_plate": "TRK1", "number": "", "trucking_company_id": 1, "active": true, "allowed_until": null }, "truck_driver": { "id": 1, "number": "DRIVER-1", "license_number": "N/A", "firstname": "DRIVER", "lastname": "ONE", "twic": null, "discarded_at": null, "active": true }, "gated_in_at": "2022-03-25T10:08:21Z", "gated_out_at": "2022-03-25T10:08:49Z" }
curl --location --request POST 'https://app.octopi.co/api/v1/trucks/:truck_license_number/gate_out.json' --header 'Authorization: Bearer token_value' --header 'Content-Type: application/json' --data-raw '{ "chassis_leaving_with_truck": ["CH101", "CH102"] }'
{ "id": 180, "truck": { "id": 1, "license_plate": "TRK1", "number": "", "trucking_company_id": 1, "active": true, "allowed_until": null }, "truck_driver": { "id": 1, "number": "DRIVER-1", "license_number": "N/A", "firstname": "DRIVER", "lastname": "ONE", "twic": null, "discarded_at": null, "active": true }, "gated_in_at": "2022-03-25T10:08:21Z", "gated_out_at": "2022-03-25T10:08:49Z" }
{ "error": "Truck Visit was not completed. The following container has unlifted holds: APLU1010203" }
Param name | Description |
---|---|
truck_license_number required |
License number of the truck Validations:
|
reason_for_incomplete optional |
Reason why interchanges were not completed Validations:
|
left_without_container optional |
Whether the truck left without a container Validations:
|
container_seals optional |
Container seals Validations:
|
container_seals[container_number] required |
Container number to which seal is added during gate out Validations:
|
container_seals[seal] required |
Seal added to the container during gate out Validations:
|
chassis_leaving_with_truck optional |
An array of chassis numbers that were used for dropping off containers and are now departing with the truck. Validations:
|