I just try make an request against amadeus API
I already have API KEY and API Secret, I pass in XHR header Authorization with value of my API key
This is my JQuery:
$.ajax({
type: "get",
url: "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MIA&destination=SFOˆduration=15&nonStop=true",
dataType: 'json',
async: true,
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization',
'Basic ' + amadeusApiKey);
},
success: function(json) {
console.log(json);
}
});
but the response is HTTP code 401 and body
{
"errors": [
{
"code": 38190,
"title": "Invalid access token",
"detail": "The access token provided in the Authorization header is invalid",
"status": 401
}
],
}
Should I make some encode with the API Key and Secret Key, I don`t find anything in the documentation