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

Sharma5 years ago

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

Tony Shelver5 years ago

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

Sharma5 years ago

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

Tony Shelver5 years ago
Sharma5 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 Shelver5 years ago

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

Sharma5 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.

Sharma5 years ago

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

Anton Tananaev5 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.

Sharma5 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 Tananaev5 years ago

Read documentation.

Sharma5 years ago

Please find me this api is possible or not..

Sharma5 years ago

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