Google Places API - REQUEST_DENIED [英] Google Places API - REQUEST_DENIED

查看:27
本文介绍了Google Places API - REQUEST_DENIED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是什么

a) sensor=true_or_false"问题
b) 密钥错误问题(除非我得到的密钥有限制)
c) 请求太多(因为我只提出一个请求)
d) 跨域(因为我从浏览器位置栏加载了 url)

a) a "sensor=true_or_false" issue
b) a key is wrong issue (unless the key I got has limitations)
c) too many requests (since I only make one request)
d) cross domain (since I load the url from the browser location bar)

我做了什么

  1. 已注册 http://code.google.com/apis/maps/signup.html

尝试了 example 在地址栏中的那个页面上(我知道脚本中的跨域)

Tried the example on that page in the location bar (I know about cross domain from script)

工作正常

阅读文档

粘贴了他们的示例,将他们的密钥交换为 我的

Pasted their example exchanging their key for mine

返回

{
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
}

到目前为止,由于错误的密钥或 sensor=true_or_false 导致所有条目都失败

So far all entries failed due to wrong key or sensor=true_or_false

例如这个网址中的网址 GooglePlaces API jQuery.ajax() 请求失败,URL 有效

And for example the url in this one Google Places API jQuery.ajax() request fails with working URL

粘贴到浏览器时也会出错.

also gives me error when pasted into the browser.

我错过了什么?

更新

所以我去拿了一些钥匙

Key for browser apps (with referers)
API key:    
AIzaSyCStj9m5LNTu9mCf6cQGDVAFKZC7Y?????
Referers:   
Any referer allowed
Activated on:   Jan 30, 2012 1:03 PM
Activated by:   me 

并尝试了 再次.还是不行.

and tried again. Still does not work.

推荐答案

这实际上是(b):错误的键.实际上,您使用了错误的种类密钥(来自 Sign适用于仅适用于 JavaScript V2 API 的 Google Maps API).

This is actually (b): wrong key. Actually, you're using the wrong kind of key (from Sign Up for the Google Maps API which is only good for the JavaScript V2 API).

请参阅获取 API 密钥了解如何获取新类型的新 API 密钥.

Please see Obtaining an API Key for how to get a new API key, of the new kind.

在出现这个问题时,在地理编码 API 上工作的有效 API 密钥在 Places API 上不起作用,但现在似乎工作正常.看起来像 Google 方面的一些问题.

At the time this question arose, valid API keys that worked on Geocoding API did not work on Places API, but now seem to work fine. Looks like some issue on Google side.

这篇关于Google Places API - REQUEST_DENIED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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