API: positions

LX3 years ago

I probably do not understand the purpose of the "from" and "to" options in the API call "positions". Since /api/positions gets all the latest positions of the devices a user sees, I expected to be able to narrow the list down to only the ones which were updated in a certain time interval (say from five minutes ago until now) using the "from" option. But this appears not to be the way it works. Rather, "from" and "to" are only operational when the call is restricted to a deviceId and then result in the route in the given time frame and not only the latest position, right?

So is there a way to get only the recent positions of all devices a user sees but only if they have been updated in a given time window?

Anton Tananaev3 years ago

You can get the latest positions for all devices by calling /api/positions without parameters.

LX3 years ago

I understand, but always getting the full load of positions creats a lot of data. Is there a way to only get the positions that have been updated in say the last five minutes?

Anton Tananaev3 years ago

There is, but you need to specify either devices or groups. You can group all your devices in a single group to make it easier.

Test Crooka year ago

when I request the position for the api without the parameters, it returns me the latest positions of current time, but for the same device when i request using the from and to parameters, I am not getting the position.

May be it is because of the time difference, so can you tell me how do i enter the time in from and to params. (I mean which is the format, and as i am in the IST format , so how much i have to subtract or add time.

Anton Tananaeva year ago

Actually that sounds like a different issue. Have you checked logs for errors and warnings?