CamperDays Api ♥
Initialize API
; const options = accessToken: String logErrors: Boolean const Api = options;
Add Logger
set options.logErrors
to true
and add a logger
;; const options = accessToken: String logErrors: true const Api = options winston;
Destination
get list of searchable destinations
Api;
Search
start a new search
const searchData = pickup: city: 40 date: 'YYYY-MM-DD' dropoff: city: 40 date: 'YYYY-MM-DD' ; const callback = { // error if connection failed // on api error error: field: 'pickup.date' code: 'invalid_pickup_date' message: 'the pickup date is invalid' ; result: null; // on api success error: null; result: requestId: '' }; Api;
Results
Get status and results
const requestId = '1037a7bac7d5d9f73ed16d0c64d18c66'; const callback = { // error if connection failed // on api error error = field: null code: 'invalid_request_identifier' message: 'result_lifetime_exceeded' ; result = null; // on api success error = null; result = requestId: '' offers: Offer status: hasResults: true searching: false }; Api;
Offer
get offer with live data
const requestId = '1037a7bac7d5d9f73ed16d0c64d18c66';const offerId = '1037a7bac7d5d9f73ed16d0c64d18c66'; const callback = { // error if connection failed // on api error error = field: null code: '' message: '' ; result = null; // on api success error: null; result: Offer}; Api;
Booking
Validate Offer, CustomerData and request reservation
const bookingData = status: 'saved' type: kind: 'booking' offer: requestId: 'xcdacsdaavdaa' offerId: 'afkjanfiosu' customer: firstName: 'Alice' lastName: 'Liddell' street: 'Hasty Rabbit Av.' streetNumber: '23' zipCode: 'OX123' city: 'Oxford' emailAddress: 'alice@wonderland.co.uk' phoneNumber: '012345678' gender: 'f' age: '23' countryCode: 'UK' language: 'de-de' passengers: firstName: 'Alice' lastName: 'Liddell' age: 23 gender: 'f' items: id: 123 amount: 2 Api;
Love ♥ Love ♥ Love ♥ Love
const appearance = beautiful: true hairColor: 'black' 'brown' hairLength: 'long' style: 'cute' relationship: 'single' glasses: true Apigirls