Search code examples
javasdkamadeus

How do I use the amadeus-java SDK to test pricing and booking flights?


I understand that the amadeus-java SDK offers methods that simplify GET and POST calls to the Amadeus Self-Service API endpoint Flight Offers Search.

Is there a way to make POST calls to Flight Offers Price and Flight Create Orders within the SDK?

If the SDK does not have methods for this, how would I retrieve the access token I fetched via SDK to make those calls explicitly?

Thanks in advance!


Solution

  • Flight Offers Price and Flight Create Orders are about to be integrated into the Java SDK (PRs opened, a bit more work to do and you will be able to use them).

    The other solution will be to use the methods post and get directly from our client like in the example below (that you can find the README description of the Java SDK):

    You can make any arbitrary API call as well directly with the .get method. Keep in mind, this returns a raw Resource

    Response response = amadeus.get("/v2/reference-data/urls/checkin-links", Params.with("airlineCode", "BA"));
    response.getResult();