Connect Geofence to Device using API

Mark Bailey5 years ago

Hi,

I have scoured the API documentation but cannot find what I am looking for.

Can someone please advise if it is possible to connect a Device to a Geofence using the API?

Anton Tananaev5 years ago

Anything you can do in the web app is possible to do via API. That's because web app uses exactly the same API.

Mark Bailey5 years ago

Any chance of a hint at which API call I should be looking at please Anton?

Anton Tananaev5 years ago

Check API requests in the developer console in your browser.

Mark Bailey5 years ago

Thanx Anton....
That helped me find what I was looking for..... /permissions

Am I correct in assuming that the order of the attributes passed in the body are critical?

For example....

MUST be ...

{
"deviceId": 10,
"geofenceId": 67
}

rather than ...

{
"geofenceId": 67, 
"deviceId": 10
}

Reason I ask is that the tool I am using creates the later and it seems Traccar is using the order of the attributes to find the right table.. tc_device_geofence but when the order is reversed it tries to find tc_geofence_device which of course does not exist.