Every day, Octopi keeps track of the average time a truck spends at a terminal. This API endpoint allows you to access these daily average truck visit duration logs.

Supported Formats

json

Errors

Code Description
404 Not found.
400 Invalid request.
500 Internal server error.

Examples

curl "https://app.octopi.co/api/v1/average_truck_visit_durations.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE" -d '{"terminal_id": 5}'
{
   "average_truck_visit_durations" : [
      {
         "terminal" : {
            "name" : "Main Terminal",
            "id" : 1
         },
         "day" : "2021-05-09",
         "duration" : 1,
         "id" : 13170
      },
      {
         "terminal" : {
            "id" : 2,
            "name" : "Side Terminal"
         },
         "duration" : 37,
         "day" : "2021-05-09",
         "id" : 13169
      },
      {
         "day" : "2021-05-07",
         "duration" : 39,
         "id" : 13150,
         "terminal" : {
            "name" : "Side Terminal",
            "id" : 2
         }
      },
      {
         "day" : "2021-05-07",
         "duration" : 38,
         "id" : 13151,
         "terminal" : {
            "name" : "Main Terminal",
            "id" : 1
         }
      }
   ],
   "actions" : {
      "last" : {
         "url" : "https://app.octopi.co/api/v1/average_truck_visit_durations.json?page=51",
         "method" : "GET"
      },
      "next" : {
         "method" : "GET",
         "url" : "https://app.octopi.co/api/v1/average_truck_visit_durations.json?page=2"
      },
      "index" : {
         "method" : "GET",
         "url" : "https://app.octopi.co/api/v1/average_truck_visit_durations"
      },
      "previous" : {
         "method" : "GET",
         "url" : "https://app.octopi.co/api/v1/average_truck_visit_durations.json?page=0"
      }
   }
}

Params

Param name Description
terminal_id
optional

Filter for a specific terminal. You must pass the terminal’s Octopi ID.

Validations:

  • Must be a String

start_date
optional

Filter for days after the start date. Must be formatted as YYYY-MM-DD.

Validations:

  • Must be a String

end_date
optional

Filter for days before the end date. Must be formatted as YYYY-MM-DD.

Validations:

  • Must be a String

page
optional

Specify which page of results to fetch. This value defaults to 1.

Validations:

  • Must be a Integer

per
optional

The number of items to be displayed. This value defaults to 10 and accepts a maximum of 100.

Validations:

  • Must be a Integer