Google方向API错误:REQUEST_DENIED [英] Google Direction APIs error: REQUEST_DENIED

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

问题描述

我们正在开发并需要方向API来测量2个地址之间的距离。
我唯一的选择是http,因为这部分应用没有地图。



我想了解方向的正确用法API,相关的键和配额。



首先,我们发出的http调用没有键。



googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745

有时我们会收回正确的回应,但很多时候我得到了OVER_QUERY_LIMIT
(尽管我们几乎没有发出任何呼叫,但是我们不可能触发任何限制)

然后在访问完链接:
https://developers.google.com/maps/文档/方向/使用限制,我们启用了API密钥并将密钥添加到了调用中。
所以现在通话看起来像这样



http://maps.googleapis.com/maps/api/directions/json?origin=43.65077% 2C-79.378425& destination = 43.63881%2C-79.42745& key = AI *** AQ



每一次,我们发出呼叫,我们得到返回REQUEST_DENIED

解决方案

我的请求(包括有效的密钥)出现的错误消息是对此API的请求必须结束SSL。使用https:而不是http:加载API。您需要通过https进行请求。

  https://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425& ;目的地= 43.63881%2C-79.42745& key = VALID_API_KEY 


We are developing and that needs the direction APIs to measure the distance between 2 addresses. The only option I have is http as this part of the app doesn't have a map.

I am trying to understand the proper usage of the direction APIs, related Keys and quota.

First we were issuing the http call without a key.

maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745

Sometimes we get back the proper response, but many times I get OVER_QUERY_LIMIT (even though we are hardly issuing any calls, it is impossible that we are triggering any limit)

Then after visiting this link: https://developers.google.com/maps/documentation/directions/usage-limits, we enabled the API key and added the key to the call. So the call now looks like this

http://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=AI***AQ

Every time, we issue the call, we get back REQUEST_DENIED

解决方案

The error message I get with your request (including a valid key) is "Requests to this API must be over SSL. Load the API with https: instead of http:". You need to make the requests over https.

https://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=VALID_API_KEY

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

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