how to create get api for fetch live location according to deviceid

Sharma4 years ago

i also create get api but not run please find the source code of this api
please help

Tony Shelver4 years ago

Why can't you use the existing API (devices)?

Sharma4 years ago

create get api for fetch last device location (longitude,latitude,devicetime) of single device using deviceid

Tony Shelver4 years ago
Sharma4 years ago

Actually fetch last device location only single device using device id
means api/devices/id(GET) .
not all devices only fetch single device.

please help are you done

Tony Shelver4 years ago

Read the documentation (in the link above), if you pass in the ID parameter, it will return only a single device

Sharma4 years ago

which url is used to find live location of single device.
and from or to what time is used.

if possible only device id not from or to time used.

Sharma4 years ago

Is this possible to this api only deviceid used ,not time

Anton Tananaev4 years ago

You can only get all devices for your user. Also, for live data fetching I would recommend to use WebSocket API instead of polling.

Sharma4 years ago

So , if not possible only single devices fetch live location .

how to create web socket api on traccar. what url is used.

Anton Tananaev4 years ago

Read documentation.

Sharma4 years ago

Please find me this api is possible or not..

Sharma4 years ago

If possible how to create get api for fetch live location of single device using uniqueId.