在这里,地图提供地图反馈 API,即提交有关其地图上缺失地点的信息。我创建了一个项目并成功生成了用于 Places API 的 API 密钥。接下来,我尝试将它与反馈 API 一起使用,但失败了。奇怪的是,没有任何凭据我得到了 200 OK。
我的要求:
- Headers 中没有任何 APP_ID 或 KEY
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
- 使用 APP_ID 和 API_KEY
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?对我来说,发送反馈然后检查其状态很重要。