Amadeus Java SDK for the Self-Service APIs is available as a Maven dependency, which the Amadeus for Developers team is continuously updating as the new APIs and features get released.
You can check the library in the Maven repository for futher information.
Step-by-step example
This tutorial will guide you through the process of creating a simple Java
application which calls the Flight Inspiration Search API using the Amadeus
for Developers Java SDK.
Using the Amadeus Java SDK
For this tutorial we will use Unix-based commands. Windows has similar commands for each task.
The requirements to follow this tutorial include:
Your favorite editor
Java installed
A build automation tool, such as Maven
Amadeus for Developers API key
Let's do something cool by calling one of our Flight Search APIs from your Java code.
To help you get started, we have created a small Maven skeleton that is ready to use.
Let's create a class FlightSearch.java in the package edu.amadeus.sdk with the following content:
packageedu.amadeus.sdk;importcom.amadeus.Amadeus;importcom.amadeus.Params;importcom.amadeus.exceptions.ResponseException;importcom.amadeus.shopping.FlightDestinations;importcom.amadeus.resources.FlightDestination;publicclassFlightSearch{publicstaticvoidmain(String[]args)throwsResponseException{Amadeusamadeus=Amadeus.builder(System.getenv()).build();Paramsparams=Params.with("origin","MAD");FlightDestination[]flightDestinations=amadeus.shopping.flightDestinations.get(params);if(flightDestinations[0].getResponse().getStatusCode()!=200){System.out.println("Wrong status code for Flight Inspiration Search: "+flightDestinations[0].getResponse().getStatusCode());System.exit(-1);}System.out.println(flightDestinations[0]);}}
Before testing the example, export your credentials in your terminal:
Now that you've tried out this example and know how to use the objects, you can review the Javadocs in this
SDK and discover new ways to use it.
Video Tutorial
You can also check the video tutorial on how to get started with the Java SDK.
Managing API rate limits
Amadeus Self-Service APIs have rate limits in place to protect against abuse by third parties. You can find Rate limit example in Java using the Amadeus Java SDK here.