首页 > 解决方案 > 这里地图 - 无法授权地图反馈 API

问题描述

在这里,地图提供地图反馈 API,即提交有关其地图上缺失地点的信息。我创建了一个项目并成功生成了用于 Places API 的 API 密钥。接下来,我尝试将它与反馈 API 一起使用,但失败了。奇怪的是,没有任何凭据我得到了 200 OK。

我的要求:

  1. 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反馈的正文(对于检查状态很重要)。

  1. 像上面一样,但为了maphub.cit.api.here.com而不是maphub.api.here.com

回复:401 Unauthorized: Authentication failed. Reason: Missing authentication credentials

  1. 使用 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。

  1. 没有任何标题的反馈状态
curl --location --request GET 'https://maphub.api.here.com/feedback/ID_FROM_FIRST_REQUEST' 

回复:403 Forbidden

如何正确授权 Here Maps Feedback API?对我来说,发送反馈然后检查其状态很重要。

标签: here-apihere-maps-restheremaps

解决方案


REST 端点*.api.here.com需要 APP_ID 和APP_CODE凭据。

但是,APP_ID 和 APP_CODE 凭证已于 2019 年 12 月弃用,取而代之的是 API 密钥(与 APP_ID 相关,但后者不再在请求中发送)。

我假设您在更改后创建了您的开发人员帐户项目,这就是您无法为 REST 服务创建旧 APP_ID 和 APP_CODE 对的原因。

通常,REST 服务现在提供了一个新端点来精确地使用 API 密钥进行身份验证,同时出于兼容性原因*.hereapi.com仍提供旧端点。*.api.here.com

问题是,我没有看到地图反馈 API 的新端点。它似乎不存在。这就是为什么我建议通过提及问题来联系 selfservesupport@here.com,因此您需要为生成的 APP_ID 提供 APP_CODE。

旧帐户具有以下部分:

在此处输入图像描述


推荐阅读