Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda