Hi guys just what the title says, I couldn’t find a solution.
Here the cURl:
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}"
Here is my code that is getting a 400 error from server:
const getToken = async () => {
try {
const res = await axios.post(
"https://test.api.amadeus.com/v1/security/oauth2/token",
null,
{
params: {
client_id: process.env.REACT_APP_AMADEUS_API_KEY,
client_secret: process.env.REACT_APP_AMADEUS_SECRET_API_KEY,
grant_type: "client_credentials",
},
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}
);
console.log(res);
} catch (error) {
console.log(error);
}};