Reputation: 51
I did everything. This is my link
http://maps.googleapis.com/maps/api/distancematrix/json?origins=39.876678,32.749386&destinations=39.901374,32.760909|39.934519,32.85764&language=tr-TR&sensor=false&option=driving&units=metric
This works. But when I add my key, it gives REQUEST_DENIED error. (this is in a php code, I upload it to server, then I execute it. (I see the REQUEST_DENIED error with "echo".) So I guess I need to take a server api key) I can see the requested json properly, that's how I see REQUEST_DENIED
Key for server apps (with IP locking)
API key:
AIzaSyAtLjmC2sNDBy8GY0ldL3QUMhXhqK*****
IPs:
174.120.10.61 (THIS IS THE IP OF THE SERVER I'M UPLOADING MY CODES)
Activated on: Apr 25, 2013 3:41 AM
Activated by: *** – you
Can someone please tell me why am I still getting REQUEST_DENIED error?
Upvotes: 2
Views: 6911
Reputation: 1124
This is late but anyone might be facing the same problem now.
Here is a checklist.
Use HTTPS Make sure you are making the request over https instead of http.
API Key Make sure the application has access to the key storage and the APIs needed have been enabled on the Google Developer Console
Check Request Parameters Make sure all request parameters are correctly typed.
Upvotes: 0
Reputation: 22212
In my case was because I didn't enable this service for my project.
It is possible to enable here:
https://console.developers.google.com/apis/library/distance-matrix-backend.googleapis.com/
Upvotes: 2
Reputation: 161384
The Google Maps Distance Matrix web service does not use a key.
https://developers.google.com/maps/documentation/distancematrix/#RequestParameters
Upvotes: 0
Reputation: 618
Google Distance Matrix API has a limit of elements set to 2500. I highly doubt it that you would have gone over this limit, as you would have to have calculated the maximum 10 x 10 matrix 25 times over. I am from South Africa, and it refused to work for any local addresses until I changed the transport mode to driving (from walking, I mean seriously, we have cars). Maybe that'll help
Upvotes: 0
Reputation: 618
REQUEST_DENIED — The service denied use of the Distance Matrix service by your web page.
Upvotes: 0