1

I'm trying to plot a route between two locations using the following URL

"https://maps.googleapis.com/maps/api/directions/json?" + params + androidKey;

where params is the latitude and longitude of the the origin and destination and androidKey is the Android Key I received from Google Console using my SHA fingerprint. I have enabled Google Maps Android API, Google Places API for Android, Google Places API Web Service amongst others, however I'm still getting the following response when I try running the application on my phone

This IP, site or mobile application is not authorized to use this API key. Request received from IP address

I tried using Server Key which resulted in the following response

This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console

Could someone please help? Thanks

user1232138
  • 5,451
  • 8
  • 37
  • 64
  • Make sure you TURN ON Places API services in console – M D Feb 02 '16 at 09:32
  • please refer this link: http://stackoverflow.com/questions/21933247/this-ip-site-or-mobile-application-is-not-authorized-to-use-this-api-key – piyush poriya Feb 02 '16 at 09:33
  • Thank you for your response. I have referred to all the StackOverflow questions regarding the issue however the issue remains. – user1232138 Feb 02 '16 at 09:39
  • @user1232138: check my answer – kevz Feb 02 '16 at 09:54
  • Possible duplicate of [This IP, site or mobile application is not authorized to use this API key](https://stackoverflow.com/q/21933247/608639) – jww Nov 11 '18 at 02:10

1 Answers1

2
  1. Make sure you have enabled Google Maps Directions API in Google Api console.
  2. You have to use your Server_key

    eg: https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=Server_key

I got the response only after enabling the APi in google api console.

kevz
  • 2,727
  • 14
  • 39