Skip to content

Commit cb76102

Browse files
authored
Merge branch 'master' into pois
2 parents 6e009b2 + f22c3f4 commit cb76102

File tree

1 file changed

+22
-49
lines changed

1 file changed

+22
-49
lines changed

README.md

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,19 @@
66
[![Dependencies](.github/images/dependencies.svg)](npmjs)
77
[![Contact Support](https://img.shields.io/badge/contact-support-blue.svg)][support]
88

9-
Amadeus provides a set of APIs for the travel industry. Flights, Hotels, Locations and more.
10-
11-
For more details see the [Node
12-
documentation](https://amadeus4dev.github.io/amadeus-node/) on
13-
[Amadeus.com](https://developers.amadeus.com).
9+
Amadeus provides a rich set of APIs for the travel industry. For more details, check out the [Amadeus for Developers Portal](https://developers.amadeus.com) or the [SDK class reference](https://amadeus4dev.github.io/amadeus-node/).
1410

1511
## Installation
1612

17-
This module has been tested using Node 6 and higher, though it should work with
18-
Node 4 and 5 as well. You can install install it using Yarn or NPM.
13+
This module has been tested using Node 6 and higher, though it should work with Node 4 and 5 as well. You can install it using Yarn or NPM.
1914

2015
```sh
2116
npm install amadeus --save
2217
```
2318

2419
## Getting Started
2520

26-
To make your first API call you will need to [register for an Amadeus Developer
27-
Account](https://developers.amadeus.com/create-account) and [set up your first
28-
application](https://developers.amadeus.com/my-apps).
21+
To make your first API call, you will need to [register](https://developers.amadeus.com/register) for an Amadeus Developer Account and [set up your first application](https://developers.amadeus.com/my-apps).
2922

3023
```js
3124
var Amadeus = require('amadeus');
@@ -59,19 +52,15 @@ var amadeus = new Amadeus({
5952
});
6053
```
6154

62-
Alternatively it can be initialized without any parameters if the environment
63-
variables `AMADEUS_CLIENT_ID` and `AMADEUS_CLIENT_SECRET` are present.
55+
Alternatively, it can be initialized without any parameters if the environment variables `AMADEUS_CLIENT_ID` and `AMADEUS_CLIENT_SECRET` are present.
6456

6557
```js
6658
var amadeus = new Amadeus();
6759
```
6860

69-
Your credentials can be found on the [Amadeus
70-
dashboard](https://developers.amadeus.com/my-apps). [Sign
71-
up](https://developers.amadeus.com/create-account) for an account today.
61+
Your credentials can be found on the [Amadeus dashboard](https://developers.amadeus.com/my-apps).
7262

73-
By default the environment for the SDK is the `test` environment. To switch to
74-
a production (paid-for) environment please switch the hostname as follows:
63+
By default, the SDK environment is set to `test` environment. To switch to a `production` (pay-as-you-go) environment, please switch the hostname as follows:
7564

7665
```js
7766
var amadeus = new Amadeus({
@@ -81,57 +70,46 @@ var amadeus = new Amadeus({
8170

8271
## Documentation
8372

84-
Amadeus has a large set of APIs, and our documentation is here to get you
85-
started today. Head over to our
86-
[Reference](https://amadeus4dev.github.io/amadeus-node/) documentation for
87-
in-depth information about every SDK method, it's arguments and return types.
73+
Amadeus has a large set of APIs, and our documentation is here to get you started today. Head over to our [reference documentation](https://amadeus4dev.github.io/amadeus-node/) for in-depth information about every SDK method, its arguments and return types.
8874

8975

90-
* [Get Started](https://amadeus4dev.github.io/amadeus-node/) documentation
91-
* [Initialize the SDK](https://amadeus4dev.github.io/amadeus-node/)
76+
* [Get Started](https://amadeus4dev.github.io/amadeus-node/)
9277
* [Find an Airport](https://amadeus4dev.github.io/amadeus-node/#airports)
93-
* [Find a Flight](https://amadeus4dev.github.io/amadeus-node/#flightoffers)
94-
* [Get Flight Inspiration](https://amadeus4dev.github.io/amadeus-node/#flightoffers)
78+
* [Find a Flight](https://amadeus4dev.github.io/amadeus-node/#flightofferssearch)
79+
* [Get Flight Inspiration](https://amadeus4dev.github.io/amadeus-node/#flightdestinations)
9580

9681
## Making API calls
9782

98-
This library conveniently maps every API path to a similar path.
99-
100-
For example, `GET /v2/reference-data/urls/checkin-links?airlineCode=BA` would be:
83+
This library conveniently maps every API path to a similar path. For example, `GET /v2/reference-data/urls/checkin-links?airlineCode=BA` would be:
10184

10285
```js
10386
amadeus.referenceData.urls.checkinLinks.get({ airlineCode: 'BA' });
10487
```
10588

106-
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path.
107-
108-
For example, `GET /v1/shopping/hotelOffer/123/` would be:
89+
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path. For example, `GET /v1/shopping/hotelOffers/123/` would be:
10990

11091
```js
11192
amadeus.shopping.hotelOffer('123').get(...);
11293
```
11394

114-
You can make any arbitrary API call as well directly with the `.client.get` method:
95+
You can make any arbitrary `GET` API call directly with the `.client.get` method as well:
11596

11697
```js
11798
amadeus.client.get('/v2/reference-data/urls/checkin-links', { airlineCode: 'BA' });
11899
```
119100

120-
Or with a `POST` using `.client.post` method:
101+
Or, with a `POST` using `.client.post` method:
121102
```js
122103
amadeus.client.post('/v1/shopping/flight-offers/pricing', JSON.stringify({ data }));
123104
```
124105

125106
## Promises
126107

127-
Every API call returns a `Promise` that either resolves or rejects. Every
128-
resolved API call returns a `Response` object containing a `body` attribute
129-
with the raw response. If the API call contained a JSON response it will parse
130-
the JSON into the `.result` attribute. If this data also contains a `data` key,
131-
it will make that available as the `.data` attribute.
108+
Every API call returns a `Promise` that either resolves or rejects.
109+
110+
Every resolved API call returns a `Response` object containing a `body` attribute with the raw response. If the API call contained a JSON response, it will parse the JSON into the `result` attribute. If this data contains a `data` key, that will be made available in `data` attribute.
132111

133-
For a failed API call it returns a `ResponseError`
134-
containing the (parsed or unparsed) response, the request, and an error code.
112+
For a failed API call, it returns a `ResponseError`object containing the (parsed or unparsed) response, the request, and an error code.
135113

136114
```js
137115
amadeus.referenceData.urls.checkinLinks.get({
@@ -149,8 +127,7 @@ amadeus.referenceData.urls.checkinLinks.get({
149127

150128
## Pagination
151129

152-
If an API endpoint supports pagination, the other pages are available under the
153-
`.next`, `.previous`, `.last` and `.first` methods.
130+
If an API endpoint supports pagination, the other pages are available under the `.next`, `.previous`, `.last` and `.first` methods.
154131

155132
```js
156133
amadeus.referenceData.locations.get({
@@ -168,7 +145,7 @@ If a page is not available, the response will resolve to `null`.
168145

169146
## Logging & Debugging
170147

171-
The SDK makes it easy to add your own logger compatible with the default `console`.
148+
The SDK makes it easy to add your own logger that is compatible with the default `console`.
172149

173150
```js
174151
var amadeus = new Amadeus({
@@ -178,10 +155,7 @@ var amadeus = new Amadeus({
178155
});
179156
```
180157

181-
Additionally, to enable more verbose logging, you can set the appropriate level
182-
on your own logger, though the easiest way would be to enable debugging via a
183-
parameter on initialization, or using the `AMADEUS_LOG_LEVEL` environment
184-
variable. The available options are `silent` (default), `warn`, and `debug`.
158+
Additionally, to enable more verbose logging, you can set the appropriate level on your own logger. The easiest way would be to enable debugging via a parameter during initialization, or using the `AMADEUS_LOG_LEVEL` environment variable. The available options are `silent` (default), `warn`, and `debug`.
185159

186160
```js
187161
var amadeus = new Amadeus({
@@ -451,8 +425,7 @@ amadeus.airport.predictions.onTime.get({
451425

452426
## Development & Contributing
453427

454-
Want to contribute? Read our [Contributors Guide](.github/CONTRIBUTING.md) for
455-
guidance on installing and running this code in a development environment.
428+
Want to contribute? Read our [Contributors Guide](.github/CONTRIBUTING.md) for guidance on installing and running this code in a development environment.
456429

457430
## License
458431

0 commit comments

Comments
 (0)