17

I am using Google Place API for getting the distance between two cities, but when I call the service via http://maps.googleapis.com/maps/api/distancematrix/json?origins=dehli&destinations=pune&mode=bicycling&language=en-EN&sensor=true&key=AppKey the service gives this response:

{

    "destination_addresses": [ ],
    "error_message": "Requests to this API must be over SSL.",
    "origin_addresses": [ ],
    "rows": [ ],
    "status": "REQUEST_DENIED"
}

What's the solution for this problem?

Chris
  • 4,661
  • 1
  • 23
  • 25
jaydev
  • 1,629
  • 5
  • 17
  • 31

1 Answers1

35

HTTP over SSL protocol URLs are prefixed with https:// and not http://.

Change http://maps.googleapis.com/maps/api/distancematrix/json?origins=dehli&destinations=pune&mode=bicycling&language=en-EN&sensor=true&key=AppKey(paste App Key)
to https://maps.googleapis.com/maps/api/distancematrix/json?origins=dehli&destinations=pune&mode=bicycling&language=en-EN&sensor=true&key=AppKey(paste App Key)

offset
  • 1,407
  • 1
  • 16
  • 34
ElmoVanKielmo
  • 10,907
  • 2
  • 32
  • 46
  • I am getting following response: REQUEST_DENIED This IP, site or mobile application is not authorized to use this API key. Request received from IP address ***.***.***.***, with empty referer – Bharat Dodeja Mar 23 '16 at 11:45
  • Check the API . Whether it is generated for web / Android / ios. Coz api generated for iOS couldnt be used by web – Rathna Kumaran May 02 '16 at 12:14