Avatar

Getting Distance Traveled along with DutyStatusLog feed

0

I am fairly new to using MyGeoTab, and I am wondering what the best method is to get the information that I need.

We are currently pulling DutyStatusLog via the DataFeed method in C#.  We need each log that comes back in these calls, and we are not having any issues getting them.  The other thing that we need with these logs, is the distance that was traveled.  I have done a lot of reading about Trips and stuff like that... but it just seems like there are so many ways to get the data, I need to know what is recommended for my situation. 

Any help would be greatly appreciated.

Erik Fisch

Please sign in to leave a comment.

2 comments

1
Avatar


To calculate the distance, please see the call below. They calculate distance travelled using a Get call for StatusData against "DiagnosticOdometerAdjustmentId".

api.call("Get", {
    "typeName": "StatusData",
    "resultsLimit": 10,
    "search":{
        deviceSearch:{id:"b1"},
        diagnosticSearch:{"id":"DiagnosticOdometerAdjustmentId"},
        fromDate:"2017-12-20T01:16:47.000Z",
        toDate:"2017-12-20T01:16:47.000Z"
    }
}, function(result) {
    console.log("Done: ", result);
}, function(e) {
    console.error("Failed:", e);
});
/*opt nomin*/

 

Thanks

 

 

Mohamed Abdelhalim 1 vote
0
Avatar

Thanks for the answer - I have seen this ability but I am still running into issues.  What happens when a driver drove in multiple vehicles for a day?  Or what if the last log for the day is driving, and there is not another ping showing that he stopped driving until sometime the next day?  How do I know how many miles he drove the rest of the first day in that situation?

Erik Fisch 0 votes