Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
Amadeus API authorization request failing because "Mandatory grant_type form parameter missing"

I am trying to request an authorization token from Amadeus using axios by following this documentation. However, I'm quite unexperienced with the axios library and am failing to build the request correctly, because I get this response:

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

The curious thing is that I tried to simulate the same request with curl and it worked, so I'm really puzzled as to where my error is. Below is my curl request

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

Here is my JavaScript code, please let me know if you are able to notice the difference! Thanks in advance

async getAmadeusKey() {
    const response = await axios({
        url: "https://test.api.amadeus.com/v1/security/oauth2/token",
        method: 'post',
        headers: {
            'Content-Type': 'x-www-form-urlencoded'
        },

        data: {
            grant_type: 'client_credentials',
            client_id: CLIENT_ID,  // of course both these constants are defined outside of this scope
            client_secret: CLIENT_SECRET,
        }
    });
    console.log(response.data);
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!