Google Maps API 请求:限制问题
我正在构建 PowerApps 应用程序,对 Google Maps API 的请求很少。首先是生成静态地图(它工作正常)。第二件事是建立流量以到达特定位置附近的地方(按类型)。
但响应中我收到错误回应:
{
"error_message": "This API project is not authorized to use this API.",
"html_attributions": [],
"results": [],
"status": "REQUEST_DENIED"
}
问题是,我们设置的 API Key 没有任何限制 - 特定的,没有使用 API 接口的限制。
也许有人解决类似的问题?
I am building PowerApps application with few requests to Google Maps API. First is generating static maps (it's working correctly). Second thing is building flow to get places near specific location (by type).
My request to API:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=XXX,YYY&radius=1500&type=restaurant&key=MY_KEY
But in response I got error response:
{
"error_message": "This API project is not authorized to use this API.",
"html_attributions": [],
"results": [],
"status": "REQUEST_DENIED"
}
Problem is that, we set API Key without any restrictions - specific without restrictions about using API interfaces.
Maybe someone resolve similar issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@geocodezip 是正确的。 Google Cloud 中的每个项目都必须单独启用 API。这与您对 API 密钥施加的限制不同。
https://console.cloud.google.com/apis/ library/places-backend.googleapis.com
如果您注意到错误消息显示您的项目未获得授权,而不是密钥。关键是没问题,你只需要在 Google Cloud 项目中启用 Places API 即可。
@geocodezip is correct. Each project within Google Cloud must have API's enabled separately. This is different from the restrictions you put on an API key.
https://console.cloud.google.com/apis/library/places-backend.googleapis.com
If you'll notice that your error message says your project is not authorized, not the key. The key is fine, you just need to enable the Places API within the Google Cloud Project.