Hi I need to calculate the distance of the first location to the second location using google MAP API but I am getting this Error [System.HttpResponse[Status=OK, StatusCode=200]]. I have tried the below code. please help me where I am doing wrong.
HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
String url = 'https://maps.googleapis.com/maps/api/distancematrix/json' + '?origins=' + recordName.Checked_In_Location__Latitude__s,recordName.Checked_In_Location__Longitude__s + '&destinations=' + recordName.Checked_Out_Location__Latitude__s,recordName.Checked_Out_Location__Longitude__s + '&mode=driving' + '&sensor=false' + '&language=en' + '&units=imperial';
//I have also tried this but did not work.
//String url = 'https://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&mode=bicycling&language=fr-FR&key=*API Name*';
req.setEndPoint(url);
HTTPResponse resp = http.send(req);
system.debug('resp====>' + resp);
Please share with me any link(I have tried google itself) or reference from I can get help. Thanks in advance