500 error when using the shopping.flightDates.get endpoint

Using your API for an fun app I am developing and I just started using your eendpoints, This particular endpoint gives me this responseError:

 body: '{"errors":[{"status":500,"code":141,"title":"SYSTEM ERROR HAS OCCURRED","detail":"ORIGIN AND DESTINATION NOT ALLOWED FOR AMA4DEV EXTREME SEARCH REQUESTS ON ENVIRONMENT"}]}',

The endpoint I am hitting is:

amadeus.shopping.flightDates.get({
    origin : 'PHX',
    destination : 'MEX'
  }).then(function(response){
    console.log(response.data);
  }).catch(function(responseError){
    console.log(responseError.response);
  });

To make sure it was not something with the auth token/secret I made sure to make a test call using your example on github that works which was:

    amadeus.shopping.flightDates.get({
    origin : 'MUC',
    destination : 'MAD'
  }).then(function(response){
    console.log(response.data);
  }).catch(function(responseError){
    console.log(responseError.response);
  });

No problem in hitting that endpoint. Thank you again for looking into this

Answer

If you use the test environment: it is free of charge but limited (limited number of API calls you can do per month and limited set of data (a subset of production data). For each API you can find the data collection available here.

For Flight Cheapest Date Search API, the test environment doesn’t have data for PHX as origin. I tried in production and it does return data. Please note that Flight Inspiration Search and Flight Cheapest Date Search are built on top of a pre-computed cache (in production). As they are inspirational APIs we do not offer all pairs of origin-destination but only the most searched all over the world. If you want to get the full list of origin-destination pairs (even smaller cities), you need to use the Flight Offers Search API.

Leave a Reply

Your email address will not be published. Required fields are marked *