value "name" also in api/positions?

qlex4 years ago

In /api/positions I can only see deviceId. Is it possible to include also name ? Currently, I need to take deviceId from positions, then compare it with api/devices and retrieve the name of the device ?

Anton Tananaev4 years ago

Why would we include device name in the position API? It doesn't make sense to me.

qlex4 years ago

Hi.
Our particilular reason is the following.
Traccar is used as module in TheTransitClock which makes the use of Traccar to feed in vehicle positions so that it can produce transit predictions in public transport. Showing internal id value (which is assigned automatically and can’t be edited) instead of name to dispatcher provides no knowledge.

We could modify Traccar module in our tool, but it would mean more queries to Traccar api, so maybe just adding that value to positions restapi response would limit our requests by 50%

Anton Tananaev4 years ago

You should just call devices API once and re-use that data in your module.