Reputation: 121
I am currently working with Google Place API, I have a problem with it whenever I am going to access this link
with entering the information like latitude,longitude and API key and set sensor equal to false,but it always shows :
{
"debug_info" : [],
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
I already searched for that kind of error and I saw that some of the post suggests to check sensor value and check the API key. I already checked it and also checked the service is enabled for Google Maps API v3
. But nothing works for me. I am new to this, I don't get what I am doing wrong, Please help.
Upvotes: 5
Views: 3258
Reputation: 1302
The "status": "REQUEST_DENIED" is returned by the Places API when:
You have not activated the Places API Service in the services tab of the APIs console.
The sensor parameter is missing from your request, or is set to something other than true or false.
The key parameter is missing from your request.
The key parameter does not match the your API key in the API Access tab of the APIs console.
Your API key has not been correctly set up in the API Access tab of the APIs Console:
If you are using a Browser key, check that your allowed Referer(s) are correct.
If you are using a Server key, check that your allowed IP(s) are correct.
Android and iOS keys are not supported, please use a Browser or Server key.
The request was not sent as an HTTPS request, HTTPS is required for all Web Service requests.
The incorrect HTTP method was used to send the request:
All requests must be sent as a GET request except for Place Actions.
All Place Actions must be sent as a POST request.
Upvotes: 0
Reputation: 4650
You are using http(s) for calling Google API, is your html also hosted under http(s). If not try changing google url to http.
Otherwise every thing else kinda looks ok so that makes me think you might wanna check your api console again, go to SERVICES and check if your 'Places API' is turned ON.
You can also try changing the Port address to 443 to get response from Places API
Upvotes: 8