Making your first API call
Step 1: Create an account
The first step to start using Amadeus Self-Service APIs is to register and create an account:
- Open the Amadeus Developers Portal.
- Click on Register.
- Complete the form using a valid email address and click on the
Create account
button. An automatic confirmation email will be sent to the email address you provided. - In the confirmation email you receive, click on
Activate your account
.
You can now log in to the portal with your new credentials! Welcome to Amadeus for Developers!
Step 2: Get your API key
To start using the APIs, you need to tell the system that you are allowed to do so. This process is called authorization.
Danger
Remember that the API Key and API Secret are for personal use only. Do not share them with anyone.
All you need to do, is to attach an alphanumeric string called token to your calls. This token will identify you as a valid user. Each token is generated from two parameters: API Key
and API Secret
. Once your account has been verified, you can get your API key and API Secret by following these steps:
- Sign in to the Developers Portal.
- Click on your username (located in the top right corner of the Developers portal page)
-
Go to My Self-Service Workspace.
-
Click on Create New App button.
-
Enter your application details and click on Create.
Important
Test environment
At this stage, you are using the testing environment, where you will enjoy a fixed number of free API call quotas per month for all your applications. When you reach the limit, you will receive an error message. This environment will help you build and test your app for free and get ready for deploying it to the market.
Step 3: Calling the API
For our first call, let's get a list of possible destinations from Paris for a maximum amount of 200 EUR using the Flight Inspiration Search API, which returns a list of destinations from a given origin along with the cheapest price for each destination.
Creating the Request
Before making your first API call, you need to get your access token. For security purposes, we implemented the oauth2
process that will give you an access token based on your API Key
and API Secret.
To retrieve the token, you need to send a POST
request to the endpoint /v1/security/oauth2/token
with the correct Content-Type
header and body. Replace {client_id}
with your API Key and {client_secret}
with your API Secret in the command below and execute it:
Warning
Please take a look at our Authorization guide to understand how the process works in depth.
According to the documentation, you need to use v1/shopping/flight-destinations
as the endpoint, followed by the mandatory query parameter origin
. As you want to filter the offers to those cheaper than 200 EUR, you need to add the maxPrice
parameter to your query as well.
Our call is therefore:
Note how we add the Authorization
header to the request with the value Bearer
string concatenated with the token previously requested.
Evaluating the Response
The response returns a JSON
object containing a list of destinations matching our criteria:
Congratulations! You have just made your first Amadeus for Developers API call!
Video Tutorial
You can check the step by step process in this video tutorial of How to make your first API call from Get Started series.
Postman collection
To start testing our APIs without any additional configuration, have a look at our dedicated Postman collection.
Test and Production environment
After successfully developing your travel app with Amadeus APIs in the Test environment, you can now move to Production. Discover the differences between the Test and Production environments in Amadeus Self-Service APIs. Find out how to seamlessly switch to Production at no cost and, depending on your quota, gain access to real-time data, improved results, and quicker response times.