api get positions by time

Leif Neland6 years ago
Anton Tananaev6 years ago

You haven't selected device, so time is ignored and you just get last positions for all you devices.

Leif Neland6 years ago

Seems like a flaw in the api to me, but if you want it like that, I'll do it... ;-)

Anton Tananaev6 years ago

How is that a flaw? Loading data from the database is expensive operation, so you need to specify devices. It doesn't make sense to load for all. If you really want to load all, you have to explicitly specify all.

Leif Neland6 years ago
Anton Tananaev6 years ago

If you get nothing, it means there's no data in the time interval you selected.

Leif Neland6 years ago

But I can only get from one device at time?

Anton Tananaev6 years ago

If you want to get multiple at the same time you can use route report API. It returns essentially the same data, but you can select multiple devices and even groups.

Leif Neland6 years ago

Damn, I got to learn to use source control on "small projects" too, so I can get back to the code which tried to get all data in one go instead of the code now which does it one device at a time.

Or even go back to the original attempt which were to fetch all the locations for all selected devices at time=t and display them, then repeat at time=t+1 etc.

I guess It's better to get all the data in one chunck.