here-api - 这里地图 - 无法授权地图反馈 API
问题描述
在这里,地图提供地图反馈 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?对我来说,发送反馈然后检查其状态很重要。
解决方案
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。
旧帐户具有以下部分:
推荐阅读
- python - Holoviews - 如何从数据框列创建并排条?
- python - 在 Python 中,空格对于编码变量 = 4 + 5 是否重要,或者将其编码为变量 = 4+5 是否可以?
- ios - 优化片段着色器
- java - 在 Java 库中,lotus.domino.Session 类方法 createDateTime() 抛出 NullPointerException
- spring - 我需要帮助类“.......”在 spring-mvc 项目中找不到
- python-3.x - 如何组合网页段落(来自包含 url 的文本文件)?
- azure-data-factory - Azure 数据工厂的 API 访问
- c# - 为什么错误显示“ArgumentException:索引超出范围”。当我在 Unity 中获得触摸增量位置时?
- python - 预测 sciklearn ValueError 的问题:操作数无法与形状一起广播
- python - python:object()不带参数