It seems to me demo4.traccar.org does not return an array of geofenceIds

capitan8 years ago

It seems to me demo4.traccar.org does not return an array of geofenceIds linked to the tracker

[{"id":8128,"attributes":{},"name":"test_traccar_01","uniqueId":"test_traccar_01","status":"offline","lastUpdate":null,"positionId":0,"groupId":0,"geofenceIds":[],"phone":"","model":"","contact":"","category":null}]
Anton Tananaev8 years ago

I think you are misunderstanding "geofenceIds" parameter. It's not linked geofences. It's the list of geofences that device is currently in.

capitan8 years ago

I absolutely understand it
This array is empty on demo4.traccar.org
Although on another server - not

Anton Tananaev8 years ago

you: does not return an array of geofenceIds

me: It’s not linked geofences

you: I absolutely understand it

I'm confused.

capitan8 years ago

[{"id":8128,"attributes":{},"name":"test_traccar_01","uniqueId":"test_traccar_01","status":"offline","lastUpdate":null,"positionId":0,"groupId":0,"geofenceIds":[],"phone":"","model":"","contact":"","category":null}]

array is empty as you see

but list geofences not empty as you see
list

Anton Tananaev8 years ago

I feel like you still don't understand what I'm talking about. Please carefully read my first comment.

capitan8 years ago

Ok.
It’s the list of geofences that device is currently in.
If the list of geofences that device is currently in not empty as you see on picture

why "geofenceIds":[] - empty ?

Anton Tananaev8 years ago

On the screenshot - list of all geofences that are linked to the device.

In the API response - list of all geofences that device is currently in.

capitan8 years ago

Then two questions )

Where in api get list of all geofences that are linked to the device?

or

Where in web front end list of all geofences that device is currently in?

Anton Tananaev8 years ago

Where in api get list of all geofences that are linked to the device?

https://www.traccar.org/api-reference/#paths_geofences_GET

Where in web front end list of all geofences that device is currently in?

It is not shown in the web interface. It's only used on the back-end at the moment.

capitan8 years ago

I see.
Thank you.
This is not very convenient if you need to get all trackers linked current geofence.
I was misled by the fact that the server of my friends returns an empty array geofenceIds”:[]