-1

I got the api key by following the usual steps. Then I was able to get map and use some inbuilt things on it like search etc Then later I tried routing, I was unable to get the routes. When I pasted the request:

https://maps.googleapis.com/maps/api/directions/json?origin=28.6100,2077.2300&destination=18.9750,72.8258&key=mykey

on the browser I got the following and realized that I don't have the permission. I searched for this problem but couldn't find the solution, please help. Response on browser:

{
   "error_message" : "This IP, site or mobile application is not authorized     to use this API key. Request received from IP address xxxxxxxx, with empty     referer",
  "routes" : [],
  "status" : "REQUEST_DENIED"
}
Zahan Safallwa
  • 3,880
  • 2
  • 25
  • 32

1 Answers1

0
  1. Make sure you are using server API key, not an Android key (mobile development). See this post:

    Google Places API request denied for Android autocomplete, even with the right api key .

  2. Also make sure you are sending the key to GooglePlaces instance.

  3. If you are restricting use of API key by IP make sure your request is coming from an allowed address.

Community
  • 1
  • 1
Zahan Safallwa
  • 3,880
  • 2
  • 25
  • 32