Skip to main content

API call to pull ExceptionTripDistance as shown on Advanced Zone Visit Report.

JBa-2021
Original Poster

Hello,

 

I am trying to use API call to pull or calculate the distances for a selected device. The end result should match with the totals shown on GeoTab's Advanced Zone Visit Report (see below).

The GeoTab report shows 6mi as 'Distance to Arrival' on 4/26/2025.

imageI've tried to pull multiple data points (including ExceptionEvent.Distance and Trip.Distance) but none have matched. Included below is payload for ExceptionEvent:

api.call("Get", {

  "typeName": "ExceptionEvent",

  "resultsLimit": 10, 

  "search":{ 

    "fromDate": "2025-04-26T00:00:00.000Z" ,

    "toDate": "2025-04-26T23:59:59.000Z",

    "devicesearch":{

      "id": "bFB"

    },  

  }

}, function(result) {

  console.log("Done: ", result);

}, function(e) {

  console.error("Failed:", e);

});

What is the correct/best way to pull this data? Any suggestion will be greatly appreciated.

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

2 Replies

EishiFUN
Community Administrator

Hello @JBa-2021​ ,

 

Thank you for asking your question in our community. I wanted to let you know I am asking our SDK team if they have any suggestions for you here. I will let you know what I hear from them as soon as I do.

 

Please reach out if you have any other questions in the meantime. We are here to help.

 

Have a great day!

Eishi FUN

JBa-2021
Original Poster

Thank you, Eishi! I think I've figured it out - When I looked at the Zone Visit report, the 'Distance to arrival' is actually the last trip's distance (in km) for a device on a day. All I need to do is pulling a list of the trips, then get the latest route and it's distance ( convert km to mile). Please confirm if this is correct. Thank you!

Still have questions?