How to get the totaldistance of a specific device

Chris5 years ago

Good morning, I want to get the total distance of a specific device, in the https://www.traccar.org/api-reference/ there is a GET operation /devices, but in device properties I do not see a totalDistance property. I want to fetch the device to my application with the use of RestTample object and then get the totalDistance, but first I must create a Device class with the respective properties. The problem is that I do not see a totalDistance property in device.

id: integer
name: string
uniqueId: string
status: string
disabled: boolean
lastUpdate: string (date-time)
in IS0 8601 format. eg. 1963-11-22T18:30:00Z

positionId: integer
groupId: integer
phone: string
model: string
contact: string
category: string
geofenceIds: integer[]
integer

Anton Tananaev5 years ago

You should look at the positions endpoint.