在这里,Maps提供了Maps Feedback API,即在他们的地图上提交关于失踪地点的信息。我创建了一个项目,并生成API密钥,我使用的地方API成功。接下来,我试图使用它与反馈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
包含以下内容的正文: 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地图反馈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
出于兼容性的原因。
问题是,我没有看到地图反馈API的新端点。它似乎不存在。这就是为什么我建议联系[email protected],通过提到这个问题,因此你需要一个APP_CODE为你生成的APP_ID。
旧账户有以下部分。