Skip to main content

Getting the data all at once

SFlee-2132
Original Poster

Hi Team,

I've been pulling data from geotab for a few years now via the APIs, but as we get bigger i need to ask a best practice question.

Currently we make a call tovgrt devices and from those devices we then make calls to get the events for those devices over a period of time. The event comes with date/time rule info etc.

then make calls to get odometer values, engine hours, coordinates, speed limits for overspend events etc etc.

I'm hoping someone will tell me I've been doing it the hard way and that there is a simpler method to pull events with the associated info of the asset at that time. Is there an option to call the apis and have a it return almost a flat table version of the assets at the time of the event?

 

Join the conversation

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

Top Answers

Sure thing! What you want is called MultiCall: https://developers.geotab.com/myGeotab/guides/concepts/#multi-call

 

Note: We only recommend using it for Get calls, not for Add, Set or Remove. If it encounters an error, it will abort part of the way through and return an error message.

4 Replies

Hey @SFlee-2132​,

 

I would say on the surface, what you're doing isn't wrong or necessarily inefficient, but it all depends on exactly what the purpose of your data feed is and exactly what data points you're getting and when those data points are relevant. Honestly, depending on your project, it might be worth setting up some time with @AaronD-Geotab-IICON​'s team so they can go through it all with you and advise you on ways to improve it. They'll be able to help you dig into very specific areas of your code to help if you're unsure of something, and can help you with different methods or objects you might not be utilizing that could be more efficient. I'm happy to help here too if you have specific questions you want to ask or if you want to write up a full project description, but if it's complex then I think meeting with Aaron's team would probably be best.

 

Thanks,

Tucker

Hello @SFlee-2132​ ,

 

Tucker is on the money here. Depending on the scale and amount of events you are tracking, it may be best to have a simple multicall structure to get the data points you need on demand, or it may be worth pulling all relevant entities via GetFeed and having a ready cache on hand as needed. NOTE: The getfeed methods can lead to a LOT of bandwidth usage that may be a deterrent.

 

You can also look at using the Notification system attached to rules, as they can perform an HTTP Post when triggered and pass information that way. NOTE: This is a 'try once and move on' type system, so if the receiving end is not listening / receiving info for any reason, you will miss out on that info. We usually recommend an api method for this reason.

SFlee-2132
Original Poster

Thanks for the responses.

 

Let's try a different tac, is it possible to make Batch calls to statusdata and logrecord? Can you point me to the documentation for that? That might solve, or at least massively mitigate issues

Sure thing! What you want is called MultiCall: https://developers.geotab.com/myGeotab/guides/concepts/#multi-call

 

Note: We only recommend using it for Get calls, not for Add, Set or Remove. If it encounters an error, it will abort part of the way through and return an error message.

Still have questions?