I would like to implement ManpMyIndia Driving Distance Matrix API in my project. I am developing a webpage where i want distance between 2 latng. below is the ajax for the same.
var url = 'https://apis.mapmyindia.com/advancedmaps/v1/<API_KEY>/distance?center=19.121694747345824,72.85332576871612&pts=19.1209841659807,72.8531851553014&rtype=0';
$.ajax({
type: "POST",
dataType: 'text',
url: "getResponse.php",
async: false,
data: {
url: JSON.stringify(api_url),
},
success: function (result) {
console.log(result);
var resdata = JSON.parse(result);
if (resdata.status == 'success') {
var jsondata = JSON.parse(resdata.data);
if (jsondata.responseCode == 200) {
console.log(jsondata.results);
}
else {
var res = 'Something went wrong in the response';
console.log(res);
}
}
else {
var error_response = "No Response from API Server. kindly check the keys or request server url"
console.log(error_response);
}
}
});
I am not able to figure it out as what code should be used in getResponse.php. I would want to know what code should i write in getResponse.php. I am new to web development.
Thanks you in advance.