新的Places API会话令牌可以使用多长时间? [英] How long do the new Places API session tokens last?

查看:73
本文介绍了新的Places API会话令牌可以使用多长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站在多个页面上使用地址自动完成功能-地址簿,送货地址,账单地址.随着下个月发布的帐单更改,我们可以将自动完成过程转换为使用会话,而不是单独的击键. ( https://cloud.google.com/maps -platform/user-guide/pricing-changes/#billing-changes )

I have a website that uses address autocomplete on multiple pages--address book, shipping address, billing address. With the billing changes releasing next month, we can convert the Autocomplete process to use sessions instead of individual keystrokes. (https://cloud.google.com/maps-platform/user-guide/pricing-changes/#billing-changes)

  • AutocompleteSessionToken适合多长时间?当前页面?一小时?十二?永久地将其计入新月份的每次显示限制吗?
  • 如果会话令牌确实过期,并且我们随请求一起发送了该令牌,结果将是什么?如果客户将网页打开了一天,然后又回来取,而我们的会话数据还没有过期,我们如何确保他们不会出现自动填充错误?

推荐答案

据我所知,尚无有关Google Maps Platform中Places API会话持续时间的官方文​​档.我可以分享一些从技术支持获得的会话信息,但是,它不能提供会话持续时间的确切值,而且看起来Google不会透露确切值.

As far as I can see there is no official documentation regarding session duration for Places API in Google Maps Platform. I can share some information about sessions obtained from the technical support, however, it doesn't provide exact value for session duration and it looks like Google won't reveal the exact value.

首先,如果您使用Maps JavaScript API的内置自动完成"小部件,它将自动为您生成会话,因此无需担心.

First of all, if you use the built-in Autocomplete widget of Maps JavaScript API, it generates sessions for you automatically, so no need to worry about it.

如果创建自己的窗口小部件,则应注意会话不会持续很长时间.自动完成会话包括一些自动完成请求(用于根据用户类型检索关于某个地点的建议),以及最多一个地方详细信息请求(用于检索有关用户选择的地方的详细信息).

If you create your own widget, you should be aware that sessions do not last very long. An autocomplete session includes some Autocomplete requests (to retrieve suggestions on a place as the user types), and at most one Places Details request (to retrieve details about the place selected by the user).

相同的会话令牌将传递到自动完成"和后续的地点详细信息"请求.

The same session token is passed to the Autocomplete and the subsequent Place Detail request.

会话从第一个自动完成请求开始(通常在用户开始输入时发生).通常,在用户选择自动完成"建议之一后,才发出地点详情"呼叫.

A session starts with the first Autocomplete request (which typically happens when the user starts typing). Typically, a Places Details call is made after the user has selected one of the Autocomplete suggestions.

用户选择位置后(例如,进行地方详情"呼叫),必须使用新的会话令牌开始新的会话.

After a user has selected a place (for example, a Places Details call is made), a new session must be started, with a new session token.

会话令牌不能用于多个用户会话.如果令牌被重用,则该会话将被视为无效,并且将对请求进行收费,就像没有提供会话令牌一样.

A session token cannot be used for more than one user session. If a token is reused, the session will be considered invalid and the requests will be charged as if no session token was provided.

如果会话令牌已过期或无效,则将按每次击键向您收费.因此,每个自动完成请求都将收费.

If session token is expired or invalidated you will be charged on the per keystroke basis. So each autocomplete request will be charged.

我希望您发现此信息有用.

I hope you find this information useful.

这篇关于新的Places API会话令牌可以使用多长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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