Search code examples
javascriptamadeus

Amadeus get Token Failed with status Code 400


i'm trying to get access token for test some APIs like Hotels Search but Token Api Failed With Status Code: 400

    code: 38187
    error: "invalid_request"
    error_description: "Mandatory grant_type form parameter missing"
    title: "Invalid parameters"

the Payload Which i sent with the request

client_id: "y028t70JGLM431t0X..."
client_secret : "XO4Hk8X1bK..."
grant_type: "client_credentials"

Solution

  • That's the cURL with the headers and payload according to the authorization guide.

    curl "https://test.api.amadeus.com/v1/security/oauth2/token" \
         -H "Content-Type: application/x-www-form-urlencoded" \
         -d "grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}"