amadeus

5.6.0

Amadeus

The Amadeus client library for accessing the travel APIs.

Initialize using your credentials:

var Amadeus = require('amadeus');
var amadeus = new Amadeus({
    clientId:    'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET'
});

Alternatively, initialize the library using the environment variables AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET

var amadeus = new Amadeus();
new Amadeus(params: Object)
Parameters
params (Object = {})
Name Description
params.clientId string the API key used to authenticate the API
params.clientSecret string the API secret used to authenticate the API
params.logger Object (default console) a console -compatible logger that accepts log , error and debug calls.
params.logLevel string (default 'warn') the log level for the client, available options are debug , warn , and silent
params.hostname string (default 'production') the name of the server API calls are made to ( production or test )
params.host string? the full domain or IP for a server to make the API clal to. Only use this if you don't want to use the provided servers
params.ssl boolean (default true) wether to use SSL for this API call
params.port number (default 443) the port to make the API call to
params.customAppId string (default null) a custom App ID to be passed in the User Agent to the server.
params.customAppVersion string (default null) a custom App Version number to be passed in the User Agent to the server.
params.http Object (default https) an optional Node/HTTP(S)-compatible client that accepts a 'request()' call with an array of options.
Properties
client (Client) : The client for making authenticated HTTP calls
version (number) : The version of this API client
Static Members
location
direction
Instance Members
previous(response)
next(response)
first(response)
last(response)

Client

A convenient wrapper around the API, allowing for generic, authenticated and unauthenticated API calls without having to manage the serialization, desrialization, and authentication.

Generally you do not need to use this object directly. Instead it is used indirectly by the various namespaced methods for every API call.

For example, the following are the semantically the same.

amadeus.client.get('/v1/reference-data/urls/checkin-links', params);
amadeus.amadeus.reference_data.urls.checkin_links.get(params);
new Client(options: Object)
Parameters
options (Object = {}) a list of options. See Amadeus .
Properties
clientId (string) : the API key used to authenticate the API
clientSecret (string) : the API secret used to authenticate the API
logger (Object) : the console -compatible logger used to debug calls
logLevel (string) : the log level for the client, available options are debug , warn , and silent . Defaults to 'silent'
host (string) : the hostname of the server API calls are made to
port (number) : the port the server API calls are made to
ssl (boolean) : wether an SSL request is made to the server
customAppId (string) : the custom App ID to be passed in the User Agent to the server
customAppVersion (string) : the custom App Version number to be passed in the User Agent to the server
http (Object) : the Node/HTTP(S)-compatible client used to make requests
version (number) : The version of this API client
Instance Members
get(path, params)
post(path, params)
delete(path, params)
debug()
warn()

ResponseError

The error that is passed to the Promise when the API call fails.

new ResponseError(response: Response)
Parameters
response (Response) the Response object containing the raw http response and the Request instance that made the API call.
Properties
response (Response) : the Response object containing the raw http response and the Request instance that made the API call.
code (string) : a unique code for this type of error. Options include NetworkError , ParserError , ResponseError , ServerError , AuthenticationError , NotFoundError and UnknownError from the Response 's parsed data

Request

A Request object containing all the compiled information about this request.

new Request(options: Object)
Parameters
options (Object)
Properties
host (string) : the host used for this API call
port (number) : the port for this API call. Standard set to 443.
ssl (boolean) : wether this API call uses SSL
scheme (string) : the scheme inferred from the SSL state
verb (string) : the HTTP method, for example GET or POST
path (string) : the full path of the API endpoint
params (Object) : the parameters to pass in the query or body
queryPath (string) : the path and query string used for the API call
bearerToken (string) : the authentication token
clientVersion (string) : the version of the Amadeus library
languageVersion (string) : the version of Node used
appId (string) : the custom ID of the application using this library
appVersion (string) : the custom version of the application using this library
headers (Object) : the request headers

Response

The response object returned for every API call.

new Response(http_response: Object, request: Request)
Parameters
http_response (Object) the response object returned from the Node/HTTP request
request (Request) the request object used to make this API call
Properties
statusCode (number) : the HTTP status code for the response, if any
body (string) : the raw body received from the API
result (Object) : the parsed JSON received from the API
data (Object) : the data attribute taken from the result
parsed (boolean) : wether the raw body has been parsed into JSON
request (Request) : the request object used to make this API call

Airport

A namespaced client for the /v1/airport endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.airport;
new Airport(client: Client)
Parameters
client (Client)
Properties
predictions (predictions)

Predictions

A namespaced client for the /v1/airport/predictions endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.airport;
new Predictions(client: Client)
Parameters
client (Client)
Properties
OnTime (predictions)

Predictions

A namespaced client for the /v1/travel/predictions/trip-purpose endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.predictions;
new Predictions(client: Client)
Parameters
client (Client)
Properties
tripPurpose (TripPurpose)
flightDelay (FlightDelay)

OnTime

A namespaced client for the /v1/airport/predictions/on-time endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.airport.predictions.onTime;
new OnTime(client: Client)
Parameters
client (Client)
Instance Members
get(params)

ItineraryPriceMetrics

A namespaced client for the `/v1/analytics/itinerary-price-metrics

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.analytics.itineraryPriceMetrics
new ItineraryPriceMetrics(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightOrder

A namespaced client for the /v1/booking/flight-orders endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.booking.flightOrder;
new FlightOrder(client: Client, orderId: any)
Parameters
client (Client)
orderId (any)
Instance Members
get()
delete()

FlightOrders

A namespaced client for the /v1/booking/flight-orders endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.booking.flightOrders;
new FlightOrders(client: Client)
Parameters
client (Client)
Instance Members
post(params)

HotelBookings

A namespaced client for the /v1/booking/hotel-bookings endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.booking.hotelBookings;
new HotelBookings(client: Client)
Parameters
client (Client)
Instance Members
post(params)

EReputation

A namespaced client for the /v2/e-reputation endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.eReputation;
new EReputation(client: Client)
Parameters
client (Client)
Properties
hotel_sentiments (hotelSentiments)

HotelSentiments

A namespaced client for the /v2/e-reputation/hotel-sentiments endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.eReputation.hotelSentiments;
new HotelSentiments(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Media

A namespaced client for the /v2/media endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.media;
new Media(client: Client)
Parameters
client (Client)
Properties
files (Files)

Files

A namespaced client for the /v2/media/files endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.media.files;
new Files(client: Client)
Parameters
client (Client)
Properties
generatedPhotos (GeneratedPhotos)

GeneratedPhotos

A namespaced client for the /v2/media/files/generated-photos endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.media.files.generatedPhotos;
new GeneratedPhotos(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Airlines

A namespaced client for the /v1/reference-data/airlines endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.airlines;
new Airlines(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Location

A namespaced client for the /v2/reference-data/locations/:location_id endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations('ALHR');
new Location(client: Client, locationId: any)
Parameters
client (Client)
locationId (any)
Properties
locationId (number)
Instance Members
get(params)

Locations

A namespaced client for the /v2/reference-data/locations endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations;
new Locations(client: Client)
Parameters
client (Client)
Properties
airports (Airports)
Instance Members
get(params)

Airports

A namespaced client for the /v2/reference-data/locations/airports endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations.airports;
new Airports(client: Client)
Parameters
client (Client)
Instance Members
get(params)

PointOfInterest

A namespaced client for the /v1/reference-data/locations/pois endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations.pointOfInterest;
new PointOfInterest(client: Client, poiId: any)
Parameters
client (Client)
poiId (any)
Instance Members
get()

bySquare

A namespaced client for the /v1/reference-data/locations/pois/by-square endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations.pointsOfInterest.bySquare;
new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

bySquare

A namespaced client for the /v1/safety/safety-rated-locations/by-square endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.safety.safetyRatedLocations.bySquare;
new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

bySquare

A namespaced client for the /v1/shopping/activities/by-square endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.activities.bySquare;
new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

PointsOfInterest

A namespaced client for the /v1/reference-data/locations/pois endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.locations.pointsOfInterest;
new PointsOfInterest(client: Client)
Parameters
client (Client)
Instance Members
get(params)

RecommendedLocations

A namespaced client for the /v1/reference-data/recommended-locations endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.recommendedLocations;
new RecommendedLocations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

A namespaced client for the /v2/reference-data/urls/checkin-links endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.referenceData.urls.checkinLinks;
new CheckinLinks(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Safety

A namespaced client for the /v1/safety endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.safety;
new Safety(client: Client)
Parameters
client (Client)
Properties
safetyRatedLocations (SafetyRatedLocations)

SafetyRatedLocation

A namespaced client for the /v1/safety/safety-rated-locations endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.safety.safetyRatedLocation;
new SafetyRatedLocation(client: Client, locationId: any)
Parameters
client (Client)
locationId (any)
Instance Members
get()

SafetyRatedLocations

A namespaced client for the /v1/safety/safety-rated-locations endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.safety.safetyRatedLocations;
new SafetyRatedLocations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Flights

A namespaced client for the /v2/schedule/flights endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.schedule.flights;
new Flights(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Shopping

A namespaced client for the /v1/shopping and /v2/shopping endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping;
new Shopping(client: Client)
Parameters
client (Client)
Properties
flightDestinations (FlightDestinations)
flightOffers (FlightOffers)
flightOffersSearch (FlightOffersSearch)
flightDates (FlightDates)
seatmaps (Seatmaps)
hotelOffers (HotelOffers)
hotelOffer (HotelOffer)
hotelOffersByHotel (HotelOffersByHotel)
Instance Members
hotelOffer(offerId?)
activity(activityId?)

Activities

A namespaced client for the /v1/shopping/activities endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.activities
new Activities(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Activity

A namespaced client for the /v1/shopping/activities/{activityId} endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.activity
new Activity(client: Client, activityId: any)
Parameters
client (Client)
activityId (any)
Instance Members
get()

FlightDates

A namespaced client for the /v1/shopping/flight-dates endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightDates;
new FlightDates(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightDestinations

A namespaced client for the /v1/shopping/flight-destinations endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightDestinations;
new FlightDestinations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightOffersSearch

A namespaced client for the /v2/shopping/flight-offers endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightOffersSeach;
new FlightOffersSearch(client: Client)
Parameters
client (Client)
Instance Members
get(params)
post(params)

FlightOffers

A namespaced client for the /v1/shopping/flight-offers endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightOffers;
new FlightOffers(client: Client)
Parameters
client (Client)

FlightChoicePrediction

A namespaced client for the /v1/shopping/flight-offers/prediction endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightOffers.prediction;
new FlightChoicePrediction(client: Client)
Parameters
client (Client)
Instance Members
post(params)

Pricing

A namespaced client for the /v1/shopping/flight-offers/pricing endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.flightOffers.pricing;
new Pricing(client: Client)
Parameters
client (Client)
Instance Members
post(params)

HotelOffer

A namespaced client for the /v2/shopping/hotel-offers/:offer_id endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.hotelOffer('XXX');
new HotelOffer(client: Client, offerId: any)
Parameters
client (Client)
offerId (any)
Properties
offerId (number)
Instance Members
get(params)

HotelOffersByHotel

A namespaced client for the /v2/shopping/hotel-offers/by-hotel endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.hotelOffersByHotel;
new HotelOffersByHotel(client: Client)
Parameters
client (Client)
Instance Members
get(params)

HotelOffers

A namespaced client for the /v2/shopping/hotel-offers endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.hotelOffers;
new HotelOffers(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Seatmaps

A namespaced client for the /v1/shopping/seatmaps endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.shopping.seatmaps;
new Seatmaps(client: Client)
Parameters
client (Client)
Instance Members
get(params)
post(params)

AirTraffic

A namespaced client for the /v1/travel/analytics/air-traffic endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.analytics.airTraffic;
new AirTraffic(client: Client)
Parameters
client (Client)

Booked

A namespaced client for the /v1/travel/analytics/air-traffic/booked endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.analytics.AirTraffic.Booked;
new Booked(client: Client)
Parameters
client (Client)
Instance Members
get(params)

BusiestPeriod

A namespaced client for the /v1/travel/analytics/air-traffic/busiest-period endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.analytics.AirTraffic.BusiestPeriod;
new BusiestPeriod(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Traveled

A namespaced client for the /v1/travel/analytics/air-traffic/traveled endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.analytics.AirTraffic.Traveled;
new Traveled(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightDelay

A namespaced client for the /v1/travel/predictions/flight-delay endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.predictions.flightDelay;
new FlightDelay(client: Client)
Parameters
client (Client)
Instance Members
get(params)

TripPurpose

A namespaced client for the /v1/travel/predictions/trip-purpose endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.predictions.tripPurpose;
new TripPurpose(client: Client)
Parameters
client (Client)
Instance Members
get(params)

TripParserJobs

A namespaced client for the /v2/travel/trip-parser-jobs endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.tripParserJobs;
new TripParserJobs(client: Client, jobId: any)
Parameters
client (Client)
jobId (any)
Properties
result (Result)
Instance Members
get()
post(params)
convertToJson(fileContentsInUTF8Format)

Result

A namespaced client for the /v2/travel/trip-parser-jobs/{jobId}/result endpoints

Access via the Amadeus object

let amadeus = new Amadeus();
amadeus.travel.tripParserJobs.result;
new Result(client: Client, jobId: any)
Parameters
client (Client)
jobId (any)
Instance Members
get()