Supported Formats

json

GET /api/v1/voyages.json

The voyages API endpoint allows querying for voyages. You can optionally pass in a page and/or per parameter

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Voyage Not Found
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/voyages.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE"
  {
    "actions": {
        "index": {
            "method": "GET",
            "url": "http://app.octopi.co/api/v1/voyages.json"
        },
        "next": {
            "method": "GET",
            "url": "http://app.octopi.co/api/v1/voyages.json?page=2"
        },
        "previous": {
            "method": "GET",
            "url": "http://app.octopi.co/api/v1/voyages.json?page=1"
        },
        "last": {
            "method": "GET",
            "url": "http://app.octopi.co/api/v1/voyages.json?page=6"
        }
    },
    "voyages": [
        {
            "id": 1204,
            "number": "346",
            "status": "departed",
            "agent": {
              "name": "AGEMAR"
            },
            "stevedoring_company": {
                "name": "Cargo Handlers B'dos Ltd"
            },
            "stevedoring_supervisors": [
                {
                    "name": "Kirk Worrell"
                }
            ],
            "last_port_of_call": {
              "name": "Kingston",
              "locode": "JMKIN"
            },
            "next_port_of_call": {
              "name": "Port Everglades",
              "locode": "USPEF"
            },
            "captain": {
              "name": "John Doe"
            },
            "tax_date": "2017-12-12",
            "number_of_tug_boats": 4,
            "arrival_number_of_tug_boats": 2,
            "departure_number_of_tug_boats": 2,
            "estimated_time_of_anchorage": "2017-04-07T02:00:00.000Z",
            "actual_time_of_anchorage": "2017-04-07T07:42:00.000Z",
            "actual_time_of_pilot_boarded": "2017-04-07T09:06:00.000Z",
            "actual_time_of_berth": "2017-04-07T10:00:00.000Z",
            "actual_time_of_customs_clearance": "2017-04-07T12:10:00.000Z",
            "actual_time_of_departure": "2017-04-07T18:00:00.000Z",
            "closing_comments": null,
            "display_name": "CFS Pafilia 346",
            "actual_time_of_departure_pilot_boarded": null,
            "estimated_time_of_departure": null,
            "created_at": "2017-04-05T18:26:52.331Z",
            "updated_at": "2017-06-05T00:02:40.577Z",
            "vessel": {
                "name": "CFS Pafilia",
                "imo": "9322853",
                "call_sign": "6YRE8",
                "vessel_type": "Container",
                "loa": 100,
                "flag": "GA",
                "gross_tonnage": 100,
                "net_tonnage": 90
            },
            "assigned_berth_area": {
                "name": "NORTH PIER B1"
            },
            "assigned_yard_area": {
                "name": "SHED 2"
            },
            "discharge_terminal": {
                "name": "CPS Yard"
            },
            "arrival_pilot": {
                "name": null
            },
            "departure_pilot": {
                "name": null
            },
            "actions": {
                "show": {
                    "method": "GET",
                    "url": nil
                }
            },
            "flex_fileds": [
              {
                "label": "Name",
                "value": "Octopi"
              }
            ]
        }
    ]
}

Params

Param name Description
page
optional

The page nr to be fetched. This value defaults to 0

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

number
optional

Filter based on voyage number.

Validations:

  • Must be a String

vessel_name
optional

Filter based on vessel name

Validations:

  • Must be a String

arrival_start
optional

Filters out voyages that arrived before this date. Must respect ISO8601 format. YYYY-MM-DD or YYYYMMDD

Validations:

  • Must be a String

arrival_end
optional

Filters out voyages that arrived after this date. Must respect ISO8601 format. YYYY-MM-DD or YYYYMMDD

Validations:

  • Must be a String

departure_start
optional

Filters out voyages that departed before this date. Must respect ISO8601 format. YYYY-MM-DD or YYYYMMDD

Validations:

  • Must be a String

departure_end
optional

Filters out voyages that departed after this date. Must respect ISO8601 format. YYYY-MM-DD or YYYYMMDD

Validations:

  • Must be a String

updated_at
optional

Filters out voyages that where updated after this date. Must respect ISO8601 format. YYYY-MM-DD or YYYYMMDD

Validations:

  • Must be a String


GET /api/v1/voyages/:number.json

PATCH /api/v1/voyages/:number.json

The voyage API endpoint allows querying for one voyage.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Voyage Not Found
500 Internal Server Error.

Examples

curl "https://app.octopi.co/api/v1/voyage/:number.json" -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=ADD TOKEN HERE"
{
   "actions": {
      "index": {
          "method": "GET",
          "url": "http://app.octopi.co/api/v1/voyages.json"
      }
   },
   "voyage" : {
      "arrival_number_of_tug_boats" : null,
      "actual_time_of_anchorage" : "2017-10-16T04:00:00Z",
      "next_port_of_call" : {
         "name" : null,
         "locode" : null
      },
      "departure_pilot" : {
         "name" : null
      },
      "assigned_berth_area" : {
         "name" : null
      },
      "actual_time_of_departure" : "2017-10-20T04:00:00Z",
      "actual_time_of_berth" : null,
      "captain" : {
         "name" : null
      },
      "estimated_time_of_anchorage" : "2017-10-16T04:00:00Z",
      "display_name" : "BLUE H 45645",
      "last_port_of_call" : {
         "name" : null,
         "locode" : null
      },
      "discharge_terminal" : {
         "name" : "BLUE TERMINAL"
      },
      "vessel" : {
         "loa" : "",
         "gross_tonnage" : 0,
         "call_sign" : null,
         "vessel_type" : "Break Bulk",
         "net_tonnage" : 0,
         "flag" : null,
         "imo" : null,
         "name" : "BLUE H"
      },
      "arrival_pilot" : {
         "name" : null
      },
      "agent" : {
         "name" : null
      },
      "actual_time_of_departure_pilot_boarded" : null,
      "tax_date" : null,
      "departure_number_of_tug_boats" : 0,
      "number_of_tug_boats" : 0,
      "ship" : {
         "vessel_type" : "Break Bulk",
         "call_sign" : null,
         "loa" : "",
         "gross_tonnage" : 0,
         "flag" : null,
         "imo" : null,
         "name" : "BLUE H",
         "net_tonnage" : 0
      },
      "closing_comments" : null,
      "actual_time_of_pilot_boarded" : null,
      "updated_at" : "2018-03-05T00:32:50Z",
      "status" : "departed",
      "estimated_time_of_departure" : null,
      "id" : 167592,
      "created_at" : "2018-03-05T00:30:33Z",
      "actual_time_of_customs_clearance" : null,
      "number" : "45645",
      "assigned_yard_area" : {
         "name" : null
      },
      "flex_fileds": [
        {
          "label": "Name",
          "value": "Octopi"
        }
      ]
   }
}
curl "https://app.octopi.co/api/v1/voyages/:number.json" -d '{"voyage": { "Captain": "Cook", "at_of_departure": "2021-12-05T18:41:17.422Z" }}' -X PATCH -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token token=YOURTOKEN"

Params

Param name Description
at_of_departure_pilot_boarded
optional

Validations:

  • Must be a String

at_of_anchorage
optional

Validations:

  • Must be a String

at_of_pilot_boarded
optional

Validations:

  • Must be a String

at_of_berth
optional

Validations:

  • Must be a String

at_of_customs_clearance
optional

Validations:

  • Must be a String

at_berth_departure
optional

Validations:

  • Must be a String

at_of_departure
optional

Validations:

  • Must be a String

agent_id
optional

Validations:

  • Must be a Integer

arrival_pilot_id
optional

Validations:

  • Must be a Integer

assigned_berth_area_id
optional

Validations:

  • Must be a Integer

assigned_yard_area_id
optional

Validations:

  • Must be a Integer

berth_end_position
optional

Validations:

  • Must be a Float

berth_start_position
optional

Validations:

  • Must be a Float

block_receiving_export_past_cut_off
optional

Validations:

  • Must be a String

captain
optional

Validations:

  • Must be a String

departed_last_port_on
optional

Validations:

  • Must be a String

departure_pilot_id
optional

Validations:

  • Must be a Integer

discharge_destination_id
optional

Validations:

  • Must be a Integer

et_of_anchorage
optional

Validations:

  • Must be a String

et_of_berth
optional

Validations:

  • Must be a String

et_of_departure
optional

Validations:

  • Must be a String

cancelled
optional

Validations:

  • Must be a String

last_port_of_call_id
optional

Validations:

  • Must be a Integer

next_port_of_call_id
optional

Validations:

  • Must be a Integer

receiving_cut_off_time
optional

Validations:

  • Must be a String

ship_id
optional

Validations:

  • Must be a Integer

stevedoring_company_id
optional

Validations:

  • Must be a Integer

tax_date
optional

Validations:

  • Must be a String

time_labour_ashore
optional

Validations:

  • Must be a String

time_labour_onboard
optional

Validations:

  • Must be a String