简体   繁体   English

如何为网站商店定位器生成百度中国的 API 密钥?

[英]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 更简单的答案:

  1. If you can't read Chinese, install the Google Translate extension in Chrome (translate.google.com can't translate HTTPS pages).如果您看不懂中文,请在 Chrome 中安装Google 翻译扩展程序(translate.google.com 无法翻译 HTTPS 页面)。 On each new page, you'll have to click the extension in the toolbar and choose "TRANSLATE THIS PAGE".在每个新页面上,您必须单击工具栏中的扩展名并选择“翻译此页面”。
  2. Create an account at http://passport.baidu.com .http://passport.baidu.com 上创建一个帐户。 You'll need a valid email address and a password.您需要一个有效的电子邮件地址和密码。
  3. Set up a developer account at http://developer.baidu.com/user/reg .http://developer.baidu.com/user/reg设置开发者账号。 You'll need to verify a mobile phone number by typing in a code sent via SMS.您需要通过输入通过短信发送的代码来验证手机号码。 A Google Voice worked for that.谷歌语音为此工作。 The format for US numbers is "(1)760-123-4567".美国号码的格式为“(1)760-123-4567”。 You only have 60 seconds to enter the 6-digit code.您只有 60 秒的时间输入 6 位代码。
  4. Go to http://lbsyun.baidu.com/apiconsole/key .访问http://lbsyun.baidu.com/apiconsole/key
  5. Click the "I agree" button.单击“我同意”按钮。
  6. Choose "Browser" as the application type.选择“浏览器”作为应用程序类型。
  7. Enter * 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.

相关问题 如何在Google Universal Analytics中跟踪商店定位器搜索字词 - How to Track Store Locator Search terms in Google Universal Analytics 我如何获得商品广告API在我网站上的链接中产生的亚马逊购买额度? - How can I get credit for amazon purchases coming from links on my website generated by the product advertising api? 如何从我的购物车中的项目生成可下载的 PDF - How can i generate downloadable PDF from the items in my Cart 如何为不同的商店分别设置Magento商店时区 - How Can I Set Magento Store Timezone For Different Stores Separately 如何在我的WordPress网站中集成Magento产品? - How can I integrate Magento products in my WordPress website? 我可以将 Cloud Firestore 用于电子商务网站吗? 如何? - Can I use Cloud Firestore for E-commerce Website? And how? 我如何建立一个使用实体框架的asp.net网站到可以与支付网关集成的购物车中? - How can I make an asp.net website which uses entity framework into a shopping cart which can integrate with a payment gateway? 无法在 NodeJS 中为 Lazada 的 API 生成签名 - Can't generate signature for Lazada's API in NodeJS 以后如何在 Wix 网站上授权/获取 Paypal 付款? - How can I authorize/capture Paypal payments at a later date on Wix website? 如何将用户从一个 url 重定向到另一个具有 JavaScript 操作(例如添加到购物车)的网站 - How can I redirect users from one url to another website that has a JavaScript action like add to cart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM