此处 Maps 提供了 Maps Feedback API,即提交有关其 map 上缺失地点的信息。
我创建了一个项目并成功生成了用于 Places API 的 API key 。接下来,我尝试将它与反馈 API 一起使用,但它失败了。奇怪的是,没有任何凭据我得到了 200 OK。
我的要求:
curl --location --request POST 'https://maphub.api.here.com/feedback/' \
--header 'Content-Type: application/vnd.here.layerObjectList+json; charset=UTF-8' \
--header 'Accept-Charset: charset=UTF-8' \
--header 'Auth-Service-Id: here_app' \
--header 'Group-Id: FGx1AWaAzKOo0imNkLmf' \
--data-raw MY_DATA
回复:
200 OK
body 包含 id
反馈(对于检查状态很重要)。maphub.cit.api.here.com
而不是 maphub.api.here.com
回复:
401 Unauthorized: Authentication failed. Reason: Missing authentication credentials
curl --location --request POST 'https://maphub.api.here.com/feedback/' \
--header 'Content-Type: application/vnd.here.layerObjectList+json; charset=UTF-8' \
--header 'Auth-Identifier: MY_APP_ID' \
--header 'Auth-Secret: MY_API_KEY' \
--header 'Group-Id: FGx1AWaAzKOo0imNkLmf' \
--header 'Auth-Service-Id: here_app' \
--data-raw MY_DATA
回复:
401 Unauthorized: Authentication for app_id MY_APP_ID FAILED (wrong app_code provided).
我的仪表板我没有任何 app_code,所以我输入了 Auth-Secret 我的 API_KEY。
curl --location --request GET 'https://maphub.api.here.com/feedback/ID_FROM_FIRST_REQUEST'
回复:
403 Forbidden
如何正确授权 Here Maps Feedback API?对我来说,发送反馈然后检查其状态很重要。
最佳答案
REST 端点 *.api.here.com
期待 APP_ID 和 APP_CODE 证书。
但是,APP_ID 和 APP_CODE 凭证已于 2019 年 12 月弃用,取而代之的是 API key (与 APP_ID 相关,但后者不再在请求中发送)。
我假设您在更改后创建了您的开发者帐户项目,这就是您无法为 REST 服务创建旧版 APP_ID 和 APP_CODE 对的原因。
通常,REST 服务现在在 *.hereapi.com
中提供一个新端点。正是为了使用 API key 进行身份验证,同时仍然提供旧端点 *.api.here.com
出于兼容性原因。
问题是,我没有看到 Map Feedback API 的新端点。它似乎不存在。
这就是为什么我建议通过提及问题联系 selfservesupport@here.com,因此您需要为生成的 APP_ID 提供 APP_CODE。
较旧的帐户具有以下部分:
关于here-api - Here Maps - 无法授权 Maps Feedback API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61633222/