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:
|