通过此处ID查找位置 [英] Finding place by HERE id

查看:86
本文介绍了通过此处ID查找位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过位置ID获取此处的位置信息.

I try to get HERE place information by place id. Something like

https://places.cit.api.here.com/places/v1/places/276u337n-1e7e6de955674eddb3ba8662d8a83bac?app_id={XXXX}&app_code={YYYY}

返回

不允许使用URL模板.请按照地方 API开发人员指南: https://developer.here.com/rest-apis/documentation/places/topics/required-user-flow.html

It is not permissible to use URL templating. Please follow the Places API Developer Guide: https://developer.here.com/rest-apis/documentation/places/topics/required-user-flow.html

我了解URL模板的用法和概念,但是该链接未向我提供通过Here ID获取地点信息的信息.有人知道该怎么做吗?

I understand the use and concept of URL templating but the link does not provide me with the information to get place information by Here ID. Anybody know how to do this?

推荐答案

简短的免责声明:我在此处的地方工作团队API.

Short disclaimer: I work in the team around HERE places API.

不支持直接查询场所ID,因为它们可能随着时间变化并变得陈旧.因此,我们的想法是客户不要在更长的时间内存储它们.

The querying for place ids directly is not supported because they might change over time and become stale. So the idea is that clients don't store them over longer periods of time.

Places API的基本入口点是首先进行搜索,例如

The basic entrypoint to the Places API is to do a search first, e.g. /discover/search and follow the href fields in the response items to get to the details of a place.

我不太确定您的用例是什么,但是如果以上情况在您的工作流程中不起作用,我建议您提取共享ID.您可以在响应字段视图"中的位置详细信息中找到这些内容,这是从s-开头的部分. 但是要获取地点详细信息,您将必须进行一次搜索并遵循href.共享ID不仅包含位置ID,还包含更多信息,因此应更可靠地解析.

I am not quite sure what your use case is but if the above doesn't work in your flow, I would suggest extracting the sharing ids. You can find those inside the place details in the response field 'view', it is the part starting with s-. But to get to the place details you will have to do a search at one point and follow the href. The sharing id contains more information than just the place id so it should resolve more reliably.

获得共享ID后,就可以使用 查找端点.准备遵循302 HTTP响应.

Once you have obtained sharing ids, you can you use the lookup endpoint. Be prepared to follow a 302 HTTP response.

这篇关于通过此处ID查找位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆