I'm trying to add a place using the google places API.
The API IS enabled and the API key is valid. Here is my code:
$url = "https://maps.googleapis.com/maps/api/place/add/json?key=MYKEY";
$content = json_encode('{
"location": {
"lat": 55.9868532,
"lng": -4.5780577
},
"accuracy": 50,
"name": "Home Made Pizza",
"types": ["other"],
"website": "http://example.com",
"language": "en-AU"
}');
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ( $status != 201 ) {
die("response $json_response");
};
curl_close($curl);
$response = json_decode($json_response);
The response I am getting is
response { "status" : "REQUEST_DENIED" }
Help :-)