Amadeus api возвращает 401 client Credentials are invalid
.Пожалуйста, проверьте код ниже.Я включил символы [
и ]
в строки учетных данных.
// here xxxxx are placeholders for real credentials (strings)
Amadeus amadeus = Amadeus.builder("[xxxxxx]","[xxxxxx]")
.setHostname("test").setHost("test.api.amadeus.com").setSsl(true).setLogLevel("debug").build();
//HttpHandler sh = new HttpHandler();
//FlightDestination[] des = sh.FlightDest();
//id = sh.id();
try {
FlightDestination[] destination1 = amadeus.shopping.flightDestinations.get(Params.with("origin", "LON"));
id = destination1[0].getOrigin();
name = destination1[0].getDestination();
email = destination1[0].getType();
}catch (ClientException e)
{
id=e.getMessage();
}catch (NetworkException e)
{
id = e.getMessage();
}catch (NotFoundException e)
{
id = e.getMessage();
}catch (ServerException e)
{
id = e.getMessage();
}catch (ParserException e)
{
id = e.getMessage();
}catch (ResponseException e)
{
id = e.getMessage();
}