I use v5.4, I have successfully create a Geofence and Link it to a Device through Web API by following the doc:
https://www.traccar.org/api-reference/#tag/Geofences
and
https://www.traccar.org/api-reference/#tag/Permissions
I also had checked the tc_geofences and tc_device_geofence, the data already there!.. that's good! :)
but If I check the device Info using method below, it shows the geoFenceIds is null, what did I miss here?
https://gps.xxxx.com/api/devices?uniqueId=86409304003418
Response:
[
{
"id": 1,
"attributes": {},
"groupId": 0,
"name": "Traccar Client iOS",
"uniqueId": "86409304003418",
"status": "online",
"lastUpdate": "2022-10-15T16:36:36.274+00:00",
"positionId": 15941,
"geofenceIds": null,
"phone": null,
"model": null,
"contact": null,
"category": null,
"disabled": false,
"expirationTime": null
}
]
in addition:
I also had tried to create a Geofence and link it to a device manually from the Traccar Portal, and I also had checked the device connection -> geofences -> and the geofence was there already!, but the geofenceIds still showing null in the Web API result. (https://xxx.xxx.com/api/devices?uniqueId=86409304003418
)
I use v5.4, I have successfully create a Geofence and Link it to a Device through Web API by following the doc:
https://www.traccar.org/api-reference/#tag/Geofences
and
https://www.traccar.org/api-reference/#tag/Permissions
I also had checked the tc_geofences and tc_device_geofence, the data already there!.. that's good! :)
but If I check the device Info using method below, it shows the geoFenceIds is null, what did I miss here?
Response:
[ { "id": 1, "attributes": {}, "groupId": 0, "name": "Traccar Client iOS", "uniqueId": "86409304003418", "status": "online", "lastUpdate": "2022-10-15T16:36:36.274+00:00", "positionId": 15941, "geofenceIds": null, "phone": null, "model": null, "contact": null, "category": null, "disabled": false, "expirationTime": null } ]