[英]How can i generate an API key for Baidu China for an website store locator?
I have been asked by our developers to give them an API key for Baidu maps so they can set up our on site store locator and I'm not really sure how to go about doing this.我们的开发人员要求我为他们提供百度地图的 API 密钥,以便他们可以设置我们的现场商店定位器,但我不确定如何进行此操作。
I tried to set up an account on Baidu but it asked for a chinese mobile number.我试图在百度上建立一个帐户,但它要求提供一个中国手机号码。 Do I have to get one of these before I can get the key?在我拿到钥匙之前,我必须得到其中之一吗? And how easy is it to work out how to obtain the key once i've got an account?一旦我有了一个帐户,找出如何获得密钥有多容易?
Can anyone advise on the best way to set this up?任何人都可以就设置此设置的最佳方法提出建议吗?
Thanks in advance!提前致谢!
Update 2016: It now appears to be possible to use non-Chinese phone numbers to create Baidu accounts, seethis page . 2016 年更新:现在似乎可以使用非中文电话号码创建百度帐户,请参阅此页面。
Once you're logged into Baidu you need to find their LBS (location-based services) cloud and go to the control center there:登录百度后,您需要找到他们的 LBS(基于位置的服务)云并转到那里的控制中心:
http://lbsyun.baidu.com/apiconsole/key http://lbsyun.baidu.com/apiconsole/key
There you click "Create a new app/key" 创建应用(0/20) (orange button).在那里单击“创建新的应用程序/密钥”创建应用程序(0/20)(橙色按钮)。 In the popup you give it a name and then in your case probably select "for server".在弹出窗口中,您为其命名,然后在您的情况下可能选择“用于服务器”。 The following list of checkboxes is for the things you want to BLOCK for your key.以下复选框列表用于您要为密钥阻止的内容。 If you want access to everything then tick NOTHING (took me a while to figure that out, I always ticked everything...)如果您想访问所有内容,请勾选“无”(我花了一段时间才弄清楚,我总是勾选所有内容...)
For server keys you can select an IP based whitelist for users, you would enter the addresses of your servers there.对于服务器密钥,您可以为用户选择基于 IP 的白名单,您可以在那里输入服务器的地址。 I'm not sure about the other (sn) option.我不确定其他(sn)选项。
When you click Confirm the new key should appear in the table, copy & use it.当您单击确认新密钥应出现在表中时,复制并使用它。
Here's an easier answer than peedee's:这是一个比 peedee 更简单的答案:
*
in the Refer whitelist (unless you want to only allow certain domains to use the API)在引用白名单中输入*
(除非您只想允许某些域使用 API)That's it.就是这样。 You'll get an "Access application (AK)" key.您将获得“访问应用程序 (AK)”密钥。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.