I'm trying to get my latitude and longitude using Google's Geolocation API
This is what the documantation indcates:
This is my POST
request to get the data
$.ajax({
type: "POST",
url: "https://www.googleapis.com/geolocation/v1/geolocate?key=API_KEY",
dataType: "application/json",
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({considerIp: true}),
success: function (response) {
console.log(response);
},
});
but I get a 404
response status:
XHR POST https://www.googleapis.com/geolocation/v1/geolocate?key=API_KEY [HTTP/3 404 Not Found 101ms]
although I can see on my Google Cloud platform that the requests are correctly made, but returned with an error.
What am I missing?