We are developing a services API to serve products definitions, an availability calendar, allow for searching for specific vacancies and eventually book through an agent. The first effort concerns the Bassac, daytime services will follow.
Part of this API is public and part will require an API key. Please contact us for an API key.
We expect TransMékong's API v1 to follow the lines of the OCTO API specification, which might well be emerging as a standard.
Some capabilities are described here as a development target, and may not be completely implemented.
All requests should be JSON. HTTP POST and GET are accepted for the public API.
All responses are JSON, they may be a superset of the API specification, typically with a pointer to human-readable information.
The base URL for the API is https://transmekong.com/api/v1
, to which one appends the endpoint name, as in: https://transmekong.com/api/v1/supplier
.
Where the API expects input, such as a product ID or a date, and is not supplied such, it will return an informative error as to what it expects to be able to fulfill the request.
Details of a product ref. / try it
Expects:
id
, the id of a product as returned in the list; then returns the details of one product.id
may be passed as data in a JSON call, or in the URI, as in /product/{id}
1)A calendar of the availability per product or service. ref. / try it
Expects:
productId
* the id of the service whose calendar to returnlocalDateStart
* and localDateEnd
*, the extent of the calendar, now limited to 50 dates
The response lists for each day the maximum availability we hold on that day for a cruise matching the productId
, regardless of boat and specific cabins available.
So a request for “productId”: “bassac-cruise_1-night_cantho-”
(over 1 night and departing from Cần Thơ) will return availability on each date departing along cantho-cantho
or cantho-caibe
.
For each day, the response only states the maximum vacancies as a number of passengers; and states as productId
the id of the cruise for that exact itinerary.
openingHours
lists departure time and expected arrival time, and lists as duration
the duration of the trip.
A more detailed availability of a given product for a given party, with:
availabilityId
unique to this availabilityexpects:
productId
* the id of the service whose availability to return, andunits
*, a list of passengers,[{“ADULT”: 2},{“CHILD”: 1}]
;optionId
* (typically DEFAULT
, to get all rooming options)localDate
, the date of the beginning of the servicelocalDateStart
and localDateEnd
, the span of dates over which to return availability, limited to 7 datesavailabilityIds
to filter the current search with. This is obscure and we do not implement this at this time.
The services are cruises over one or more nights, between 2 ports.
To allow flexibility in mapping availability, we define services (productId
s) with 3 levels of precision.
This is our interpretation.
optionId
identifies the cabins:
CABIN
: cabin, double-occupancySINGLE
: cabin, single-occupancyDBL
: cabin, twin-bedded, double-occupancyTWIN
: cabin, twin-bedded, double-occupancy