API Traccar how GET DeviceTotalDistance?

Xelgo8 years ago

Hello Guys! Need help, How i can GET DeviceTotalDistance with default API?
http://GPSSERVER:777/api/devices? - Return data without Parameters DeviceTotalDistance

Anton Tananaev8 years ago

Total distance is stored in "position", not "device" object.

Xelgo8 years ago

Hello,Anton!
positions

GET /positions

Summary: Fetches a list of Positions

response:

<trkpt lat="51.522910" lon="46.007443"><time>2017-07-07T14:40:28.000+04:00</time><geoidheight>0.000000</geoidheight><course>260.000000</course><speed>0.000000</speed></trkpt>
<trkpt lat="51.522910" lon="46.007443"><time>2017-07-07T14:40:39.000+04:00</time><geoidheight>0.000000</geoidheight><course>260.000000</course><speed>0.000000</speed></trkpt>

I don't see devicetotaldistance in response.

I need this param:

Anton Tananaev8 years ago

You should include "Accept" header with "application/json" value in your request.

Xelgo8 years ago

Yea, Thanks you!