@leisurelink/dreamcatcher-client
v0.0.5-fix-for-bdc
Published
node.js client for adaptor calls to the public api
Downloads
5
Keywords
Readme
dreamcatcher-client
node.js client for adaptor calls to the public api
Package.json
"dreamcatcher-client": "git+ssh://[email protected]/LeisureLink/dreamcatcher-client.git#master"
Initializing the client
Before making any calls to the dreamcatcher API using the client, it must be initialized with the API key, URL of the correct API (dev or prod) you wish to access, and an optional timeout value through the init method.
var dreamcatcher_client = require('dreamcatcher-client');
dreamcatcher_client.init(apiKey, baseURL, timeout);
Using the client
The dreamcatcher client supports all of the calls detailed in the LeisureLink Integration Hub API and Public Distribution API documentation:
LeisureLink Integration Hub API
LeisureLink Public Distribution API
Calls follow a standard format:
dreamcatcher_client.*httpverbTypeOfInformation*(id, queryParams, body, callback)
where only the relevant parameters are included. For example:
dreamcatcher_client.getAvailability(rentalUnitId, queryParams, callback);
For a full listing of available methods and their signatures, see below.
queryParams is simply an object containing key(s) for each query parameter associated with the call and their appropriate value. Continuing the getAvailability example, you might pass in the following for queryParams:
{
days: 180
}
To see what parameters are available for each call, please refer to the API documentation linked above.
Methods
$.init(apiKey, baseUrl, timeout)
$.getRentalUnitDetail(rentalUnitId, callback)
$.getRentalUnitList(queryParams, callback)
$.getAvailability(rentalUnitId, queryParams, callback)
$.postAvailability(rentalUnitId, body, callback)
$.postCheckAvailability(rentalUnitId, body, callback)
$.getBaseRates(rentalUnitId, body, callback)
$.postBaseRates(rentalUnitId, body, callback)
$.getStayRestrictions(rentalUnitId, callback)
$.postStayRestrictions(rentalUnitId, body, callback)
$.getBooking(bookingId, callback)
$.postQuote(body, callback)
$.postBooking(body, callback)
$.postBookingCancellation(bookingId, body, callback)
$.getCheckInInformation(rentalUnitId, callback)
$.getHubBooking(hubBookingId, callback)
$.postHubBooking(hubBookingId, callback)
$.postHubBookingConfirmation(hubBookingId, body, callback)
$.postHubBookingFailure(hubBookingId, body, callback)
$.postHubBookingCancellation(hubBookingId, body, callback)
$.postHubBookingCancellationConfirmation(hubBookingId, body, callback)
$.getSpecials(rentalUnitId, callback)
$.putSpecial(specialId, body, callback)
$.getUpdateLog(queryParams, callback)