Amadeus 兴趣点搜索 INVALID_DATA_RECEIVED

Amadeus Point of Interest Search INVALID_DATA_RECEIVED

使用 Amadeus Node SDK,Amadeus Points of Interest API 仅适用于某些地理坐标。

我目前正在查看法国的一些兴趣点,但巴黎北部的一切似乎都不起作用,Amadeus 响应错误 INVALID DATA RECEIVED

有效坐标示例(法国奥尔良):

纬度: 47.90082
经度: 1.90283

无效坐标示例(法国鲁昂):

纬度:49.443231 经度: 1.0999

示例错误响应:

{"response":{"contentType":"application/vnd.amadeus+json","statusCode":400,"request":{"host":"api.amadeus.com","port":443,"ssl":true,"scheme":"https","verb":"GET","path":"/v1/reference-data/locations/pois","params":{"latitude":49.443231,"longitude":1.0999,"radius":20},"queryPath":"/v1/reference-data/locations/pois?latitude=49.443231&longitude=1.0999&radius=20","bearerToken":"TOKEN","clientVersion":"4.0.0","languageVersion":"12.2.0","appId":null,"appVersion":null,"headers":{"User-Agent":"amadeus-node/4.0.0 node/12.2.0","Accept":"application/json, application/vnd.amadeus+json","Authorization":"Bearer TOKEN","Content-Type":"application/vnd.amadeus+json"}},"body":"{"errors":[{"status":400,"code":4926,"title":"INVALID DATA RECEIVED","detail":"","source":{"parameters":["longitude"]}}]}","result":{"errors":[{"status":400,"code":4926,"title":"INVALID DATA RECEIVED","detail":"","source":{"parameters":["longitude"]}}]},"parsed":true},"description":[{"status":400,"code":4926,"title":"INVALID DATA RECEIVED","detail":"","source":{"parameters":["longitude"]}}],"code":"ClientError"}"} 
var Amadeus = require('amadeus');

var amadeus = new Amadeus({
  clientId: 'PRODUCTION_ID',
  clientSecret: 'PRODUCTION_SECRET',
  hostname: 'production'
});

exports.autocompleteCreate = async (req, res) => {

    console.log(req.body);
    // I'm getting lat/lng from a POST request
    var latitude = parseFloat(JSON.stringify(req.body.latitude).toString().substring(0,9));
    var longitude = parseFloat(JSON.stringify(req.body.longitude).toString().substring(0,6));

    amadeus.referenceData.locations.pointsOfInterest.get({
        latitude: latitude,
        longitude: longitude,
        radius: 20
    }).then(
        function(response) {
            console.log(response)
        })
}

问题与半径的计算有关(针对特定地点)。它已被修复并交付。你不应该再面对这个问题了。