This resource allows clients to view or manipulate truck visits within Ocotpi.
This API endpoint allows you to fetch truck visits.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl "https://app.octopi.co/api/v1/truck_visits.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE" -d '{"trucking_company_id":118,"truck_id":3274,"truck_driver_id":23801,"start_date":"2020-11-25","end_date":"2020-11-26"}'
{
"truck_visits": [
{
"id": 1164576,
"truck": {
"id": 3274,
"license_plate": "JA1111",
"number": "428",
"trucking_company_id": 118,
"active": true,
"allowed_until": null
},
"truck_driver": {
"id": 23801,
"fullname": "John Doe",
"license_number": "611574",
"twic": "",
"number": "633353",
"active": true,
"date_of_birth": null,
"telephone_number": null,
"email": null,
"remarks": null,
"trucking_company": "TruckingCo1",
"allowed_until": null,
"created_at": "2017-09-15T15:47:12Z",
"updated_at": "2023-09-15T15:47:12Z"
},
"gated_in_at": "2020-11-25T22:47:55Z",
"gated_out_at": "2020-11-25T23:14:55Z",
"trucking_company": {
"id": 118,
"name": "MARTAINER, INC.",
"code": null
},
"gate": {
"id": 108,
"name": "South Gate"
},
"gate_in_user": {
"id": 709,
"email": "email@gmail.com",
"firstname": "firstname",
"lastname": "lastname",
"name": "Firstname Lastname"
},
"gate_out_user": {
"id": 401,
"email": "email2@gmail.com",
"firstname": "firstname",
"lastname": "lastname",
"name": "Firstname Lastname"
},
"interchanges": [
{
"id": 1358853,
"type": "interchange_in",
"completed": true,
"container": {
"id": 920131,
"number": "KOSU4921341",
"goods": "N/A",
"container_type_label": "40HC",
"container_status": "full"
},
"chassis": {
"id": 39528,
"number": "CAMD4370"
}
},
{
"id": 1358903,
"type": "interchange_out",
"completed": true,
"container": {
"id": 1956749,
"number": "KOSU6216253",
"goods": "FRESH PUMPKIN TEMP +45 F 20 % OPEN",
"container_type_label": "40RF",
"container_status": "full",
"operating_reefer": true,
"reefer_temperature": "45.1",
"reefer_set_point_temperature": "45.0",
"supply_temperature": null
},
"chassis": {
"id": 39849,
"number": "CAMD5034"
},
"genset": {
"id": 5895,
"number": "G335"
}
}
],
"duration": "27"
},
{
"id": 1164057,
"truck": {
"id": 3274,
"license_plate": "JA111",
"number": "428",
"trucking_company_id": 118,
"active": true,
"allowed_until": null
},
"truck_driver": {
"id": 23801,
"number": "611574",
"license_number": "N/A",
"firstname": "firstname",
"lastname": "lastname",
"twic": "",
"active": true
},
"gated_in_at": "2020-11-25T19:17:56Z",
"gated_out_at": "2020-11-25T20:17:28Z",
"trucking_company": {
"id": 118,
"name": "MARTAINER, INC.",
"code": null
},
"gate": {
"id": 98,
"name": "West Gate"
},
"gate_in_user": {
"id": 418,
"email": "email@gmail.com",
"firstname": "firstname",
"lastname": "lastname",
"name": "Firstname Lastname"
},
"gate_out_user": {
"id": 3456,
"email": "email2@gmail.com",
"firstname": "firstname",
"lastname": "lastname",
"name": "Firstname Lastname"
},
"interchanges": [
{
"id": 1358268,
"type": "interchange_in",
"completed": true,
"chassis": {
"id": 45326,
"number": "CAMD7003"
}
},
{
"id": 1358420,
"type": "interchange_out",
"completed": true,
"container": {
"id": 920131,
"number": "KOSU4921341",
"goods": "N/A",
"container_type_label": "40HC",
"container_status": "empty"
},
"chassis": {
"id": 39528,
"number": "CAMD4370"
}
}
],
"duration": "60"
}
]
}
| Param name | Description |
|---|---|
|
truck_id optional |
Filter truck visits associated with a truck. You can pass the truck Octopi ID or the truck license plate. Validations:
|
|
truck_driver_id optional |
Filter truck visits associated with a truck driver. You must pass the truck driver Octopi ID. Validations:
|
|
trucking_company_id optional |
Filter truck visits associated with a trucking company. You can pass the trucking company Octopi ID or the trucking company code. Validations:
|
|
gate_ids optional |
Filter truck visits associated with gates. You must pass an array of gate Octopi IDs. Validations:
|
|
user_id optional |
Filter truck visits associated with a user. You must pass the user’s Octopi ID. Validations:
|
|
container_id optional |
Filter truck visits associated with a container. You can pass the container Octopi ID or the container number. Validations:
|
|
chassis_id optional |
Filter truck visits associated with a chassis. You can pass the chassis Octopi ID or the chassis number. Validations:
|
|
genset_id optional |
Filter truck visits associated with a genset. You can pass the genset Octopi ID or the genset number. Validations:
|
|
start_date optional |
Filter truck visits for which gate in occurred after the start date. Must be formatted as YYYY-MM-DD. Validations:
|
|
end_date optional |
Filter truck visits for which gate in occurred before the end date. Must be formatted as YYYY-MM-DD. 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:
|
Returns information about the truck visit.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl "https://app.octopi.co/api/v1/truck_visits/123.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE"'
{
"id": 123,
"truck": {
"id": 2787,
"license_plate": "ABCX59",
"number": "270",
"trucking_company_id": 100,
"active": true,
"allowed_until": null
},
"truck_driver": {
"id": 23801,
"fullname": "John Doe",
"license_number": "611574",
"twic": "",
"number": "633353",
"active": true,
"date_of_birth": null,
"telephone_number": null,
"email": null,
"remarks": null,
"trucking_company": "TruckingCo1",
"allowed_until": null,
"created_at": "2017-09-15T15:47:12Z",
"updated_at": "2023-09-15T15:47:12Z"
},
"gated_in_at": null,
"gated_out_at": null,
"trucking_company": {
"id": 118,
"name": "MARTAINER, INC.",
"code": null
},
"gate": {
"id": 12,
"name": "Some Gate"
},
"gate_in_user": {
"id": 543,
"email": "jim.shim@terminal.com",
"firstname": "Jim",
"lastname": "Shim",
"name": "Jim Shim"
},
"interchanges": [],
"duration": "0"
}
| Param name | Description |
|---|---|
|
id required |
Retrieve information regarding a specific truck visit with the truck visit’s ID in Octopi. Validations:
|
Creates a new TBD truck visit or truck visit with interchanges when a pre advice number is provided.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl "https://app.octopi.co/api/v1/truck_visits.json"
-d '{
"truck_driver_number": "1231NU78",
"gate": "North Gate",
"truck": "ABC123",
"comment": "Arrived early"
}'
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Token token=YOURTOKEN"
{
"truck_visit": {
"id": 1876441,
"gated_in_at": "2022-06-01T07:29:45Z",
"gated_out_at": null
},
"gate_name": "North Gate",
"truck_driver": "Agua Agua",
"truck": "ABC123",
"comment": "Arrived early"
}
{ "error": "Truck is already at the terminal." }
| Param name | Description |
|---|---|
|
truck_driver_id optional |
Truck driver ID. If this parameter is present, truck_driver_number and truck_driver_license will be ignored. Validations:
|
|
truck_driver_number optional |
Truck driver number. If truck_driver_id is present, this will be ignored. Validations:
|
|
truck_driver_license optional |
Truck driver license number. If truck_driver_id or truck_driver_number is present, this will be ignored. Validations:
|
|
truck required |
Truck license plate number. Validations:
|
|
gate required |
In Gate name or client identifier. Validations:
|
|
out_gate optional |
Out Gate name or client identifier. Validations:
|
|
comment optional |
A comment for this truck visit. Validations:
|
|
pre_advice_number optional |
Provide Pre Advice number as stored in Octopi to create truck visit and interchanges from a pre-advice. Please note that other params except gate will be ignored when a pre-advice number is provided. Validations:
|
|
interchanges_completed_at optional |
The date and time of completion of all the interchanges in the pre advice. Provide ISO 8601 format (Eg 2023-04-13T14:30:00Z). Providing this value will create the interchanges of truck visit with a completed status. Validations:
|