Get Started with Amadeus Self-Service APIs
Learn to set up a developer account and generate keys to call the Amadeus Self-Service APIs.
We'll cover the following
Let's look at the steps required to call the Amadeus Self-Service APIs.
Set up a developer account
To call the Amadeus Self-Service APIs, we need to register and create a developer account. Follow these steps to create an account:
Go to Amadeus for Developers and click the "Register" button at the top right corner.
This redirects us to the "Create an account" page. Fill in the form and agree to the terms of use, then click the "Create account" button.
An automatic confirmation email is sent to the email address we registered. Click the "Activate your account" button given in the email.
This opens up a sign-in page. Click the "Activate your account" button to complete account registration. We now get redirected to the homepage with the account activation confirmation message.
We can now log in to the developer portal with our new credentials. Head to Amadeus for Developers again and click the "Sign In" button at the top right corner.
This redirects us to the "Sign in" page. Enter your "Email" and "Password" and click the "Login" button.
Create an application
After setting up our developer account and signing in, we have to create an application. This allows us to get the API keys that we'll use to generate an ACCESS_TOKEN
to make calls to the Amadeus Self-Service APIs. Follow the given steps to create an application and get the API keys:
Click your username at the top right corner and select "My Self-Service Workspace" from the dropdown menu.
We get redirected to the "My apps" page of the "My Self-Service Workspace." Click the "Create new app" button.
We now see the "Create new app" page. Enter "TestApp" for "App name" and click the "Create" button.
Get API keys
Now that we have created an app, we can get the API keys that'll enable us to generate the ACCESS_TOKEN
required to make calls to the Amadeus Self-Service APIs.
Upon successful creation of the app, you'll be redirected to the app page where you'll see your "API Key" and "API Secret" under the "App Keys" tab. Copy the "API Key" and "API Secret." Click the "Edit" button in the code widget below and enter the two keys in their respective textboxes. Then, click the "Save" button.
Generate an access token
Click the "Run" button in the widget below to generate an ACCESS_TOKEN
.
// Defining import libraries hereimport fetch from 'node-fetch';// Define endpoint URL hereconst endpointUrl = new URL(`https://test.api.amadeus.com/v1/security/oauth2/token`);// Define header parameters hereconst headerParameters = {contentType: 'application/json',};// Define body parameters hereconst bodyParameters = new URLSearchParams({grant_type: 'client_credentials',client_id: '{{API_KEY}}',client_secret: '{{API_SECRET}}'});// Setting API call optionsconst options = {method: 'POST',headers: headerParameters,body: bodyParameters,};// Function to make API callasync function generateAccessToken() {try {const response = await fetch(endpointUrl, options);// Printing responseprintResponse(response);} catch (error) {// Printing error messageprintError(error);}}// Calling function to make API callgenerateAccessToken();
Note: The
ACCESS_TOKEN
expires after 30 minutes. Therefore, we'll generate anACCESS_TOKEN
implicitly for each API request.
Now that we have created our developer account, registered a new application, and learned how to generate an ACCESS_TOKEN
, we are ready to make our first call to the Amadeus Self-Service APIs!