错误错误消息-这里Geocode API-InvalidCredentials

时间:2018-12-09 20:46:14

标签: geocoding here-api

我有一个需要转换为坐标的地址列表,此处Geocode API在列表中间停止,并返回“ InvalidCredentials” /“ PermissionError”,这是错误的,因为我的凭据有效。

下面的完整错误消息:

<ns2:Error xmlns:ns2="http://www.navteq.com/lbsp/Errors/1" type="PermissionError" subtype="InvalidCredentials"><Details>invalid credentials for </Details></ns2:Error>

然后我检查了我的请求,发现问题不是关于凭据,而是地址文本中的“#”。

错误消息是错误的,如果Here可以针对这种情况专门更改其消息,则将非常有帮助。

可以通过在地址字符串中使用“#”来重复该操作:

例如:https://geocoder.api.here.com/6.2/geocode.json?searchtext=1920+River+Rd+Apt#57,+Tucson,+AZ&app_id=:your_app_id&app_code=:your_app_code&gen=9

如果在请求中删除“#”,它将返回200并成功。另请注意,您可能需要将应用程序ID和应用程序代码放在上面的网址中。

希望这篇文章可以对遇到相同问题的其他人有所帮助,API开发人员可以在此处看到此消息,并可能更改其返回消息。

1 个答案:

答案 0 :(得分:0)

“#”需要编码为%23。参见URL Encoding