You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/).
14
10
15
11
## Installation
16
12
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.
19
14
20
15
```sh
21
16
npm install amadeus --save
22
17
```
23
18
24
19
## Getting Started
25
20
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
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).
29
22
30
23
```js
31
24
var Amadeus =require('amadeus');
@@ -59,19 +52,15 @@ var amadeus = new Amadeus({
59
52
});
60
53
```
61
54
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.
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).
72
62
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:
75
64
76
65
```js
77
66
var amadeus =newAmadeus({
@@ -81,57 +70,46 @@ var amadeus = new Amadeus({
81
70
82
71
## Documentation
83
72
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.
amadeus.client.post('/v1/shopping/flight-offers/pricing', JSON.stringify({ data }));
123
104
```
124
105
125
106
## Promises
126
107
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.
132
111
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.
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.
154
131
155
132
```js
156
133
amadeus.referenceData.locations.get({
@@ -168,7 +145,7 @@ If a page is not available, the response will resolve to `null`.
168
145
169
146
## Logging & Debugging
170
147
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`.
172
149
173
150
```js
174
151
var amadeus =newAmadeus({
@@ -178,10 +155,7 @@ var amadeus = new Amadeus({
178
155
});
179
156
```
180
157
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`.
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.
0 commit comments