Google Direction APIs error: REQUEST_DENIED

孤人 提交于 2019-12-11 15:20:08

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/46748233/google-direction-apis-error-request-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!