Route API
This section describes the API method to obtain the details of a route, return the list of all current routes, update a route, or add a new route. The route list is dynamic and updated frequently.
Note: The sample requests contained in this document are for reference only. You will not be able to run the examples as is. Please construct your requests based on your authorization token and data requests with your own data values.
Generating the Request
As an example, request the following request will return the list of current routes.
// Example Request
curl -v -X GET 'https://lclxchange.com/api/route' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>"
On a successful authentication the result will look something like:
//Example Results
{
"routes": {
"0": {
"index": 4,
"origin": "Long Beach",
"destination": "Hong Kong",
"cycutoff": "2018-12-24 17:00:00",
"cfscutoff": "2018-12-19 17:00:00",
"estDeparture": "2018-12-24 17:00:00",
"estArrival": "2019-01-07 08:00:00",
"carrier": 6,
"vesselName": "Sweet Mary",
"voyageId": "SM0112",
"timezone": "America/Los_Angeles"
},
"1": {
"index": 5,
"origin": "New York",
"destination": "Penang",
"cycutoff": "2019-01-15 17:00:00",
"cfscutoff": "2019-01-07 17:00:00",
"estDeparture": "2019-01-15 17:00:00",
"estArrival": "2019-01-31 08:00:00",
"carrier": 21,
"vesselName": "Wan Hai 1",
"voyageId": "ABC123",
"timezone": "America/New_York"
}
}
}
As another example, the request specifying an index will return one route result.
// Example Request
curl -v -X GET 'https://lclxchange.com/api/route' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>" -d
'{
"index" : "<index_value>"
}'
On a successful authentication the result will look something like:
//Example Result
{
"routes": {
"0": {
"index": 5,
"origin": "New York",
"destination": "Penang",
"cycutoff": "2019-01-15 17:00:00",
"cfscutoff": "2019-01-07 17:00:00",
"estDeparture": "2019-01-15 17:00:00",
"estArrival": "2019-01-31 08:00:00",
"carrier": 21,
"vesselName": "Wan Hai 1",
"voyageId": "SM0112",
"timezone": "America/New_York"
}
}
}
Publishing a Route
The route API allows the publishing of individual route details for use on other API queries or within the website. In order to accomplish this action, you will need to create a POST request. Use the following example shows how to publish a route.
//Example Route Publish
curl -v -X POST 'https://lclxchange.com/api/route' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>" -d
'{
"origin": "Mumbai",
"destination": "Oakland",
"cycutoff": "2019-01-15 17:00:00",
"cfscutoff": "2019-01-07 17:00:00",
"departure": "2019-01-15 17:00:00",
"arrival": "2019-01-31 08:00:00",
"carrier": 21,
"vessel": "Alameda",
"voyageId": "ABCDE111",
"timezone": "America/New_York"
}'
Updating Route Details
In order to update a route you will need to generate a PUT request with a JSON formatted data set.
Note: It is required that the route update request contain the entire route details, not just the items identified for the update.
//Example Route Update
curl -v -X PUT 'https://lclxchange.com/api/route' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>" -d
'{
"index": 5,
"origin": "Hamburg",
"destination": "Oakland",
"cycutoff": "2019-01-15 17:00:00",
"cfscutoff": "2019-01-07 17:00:00",
"departure": "2019-01-15 17:00:00",
"arrival": "2019-01-31 08:00:00",
"carrier": 21,
"vessel": "Wan Hai 1",
"voyageId": "ABCDE111",
"timezone": "America/Hamburg"
}
An error or invalid credentials will return:
{
"Unauthorized": "Access denied."
}
API REQUEST DETAILS
This section provides information about what is required to generate a route API GET Request. These fields populate the JSON request.
GET | POST | PUT | Component | Description |
---|---|---|---|---|
index | The index of the target route |
|||
origin | The route origin (port or city) |
|||
destination | The route destination (port or city) |
|||
carrierId | The index of the carrier (see Carrier API) |
|||
vessel | The name of the vessel |
|||
voyageId | The voyage number for the route |
|||
departure | The date and time of the route estimated departure (format yyyy-mm-dd HH:mm:ss) |
|||
departStart | The start date and time of the route estimated departure (format yyyy-mm-dd HH:mm:ss) |
|||
departEnd | The end date and time of the route estimated departure (format yyyy-mm-dd HH:mm:ss) |
|||
arrival | The date and time of the route estimated arrival (format yyyy-mm-dd HH:mm:ss) |
|||
arrivalStart | The start date and time of the route estimated arrival (format yyyy-mm-dd HH:mm:ss) |
|||
arrivalEnd | The end date and time of the route estimated arrival (format yyyy-mm-dd HH:mm:ss) |
|||
cycutoff | The date and time of the container yard cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
cyStart | The start date and time of the container yard cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
cyEnd | The end date and time of the container yard cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
cfscutoff | The date and time of the container yard cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
cfsStart | The start date and time of the container freight station cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
cfsEnd | The end date and time of the container freight station cut-off (format yyyy-mm-dd HH:mm:ss) |
|||
timezone | The time zone used at the cfs, cy and departure dates |
|||
offset | The page offset starting at 0 |
|||
rowsperpage | The number of results to return per page, this value must be included with offset |
|||
The URL of the API Services |
https://lclxchange.com/api/route |
|||
Query Parameters |
None |
|||
HTTP Request Body |
A JSON formatted GET, PUT, or POST request. |