You are using wrong API to link geofences. Please read official API documentation.
In official API documentation:
Permission: object
DESCRIPTION
This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }
PROPERTIES
userId: integer
User Id, can be only first parameter
deviceId: integer
Device Id, can be first parameter or second only in combination with userId
groupId: integer
Group Id, can be first parameter or second only in combination with userId
geofenceId: integer
Geofence Id, can be second parameter only
calendarId: integer
Geofence Id, can be second parameter only and only in combination with userId
attributeId: integer
Computed Attribute Id, can be second parameter only
driverId: integer
Driver Id, can be second parameter only
managedUserId: integer
User Id, can be second parameter only and only in combination with userId
my post:
https://github.com/ginppian/borrar/blob/master/post.png
my db:
https://github.com/ginppian/borrar/blob/master/geofences.png
https://github.com/ginppian/borrar/blob/master/devices.png
what am i doing wrong ?
From what I can see your deviceId
is 4
.
What version of Traccar are you using?
3.13
You have upgrade if you want to use latest API.
I installed the new version (3.14) and I cann't:
https://github.com/ginppian/borrar/blob/master/nv-body.png
https://github.com/ginppian/borrar/blob/master/nv-headers.png
https://github.com/ginppian/borrar/blob/master/nv-devices.png
https://github.com/ginppian/borrar/blob/master/nv-geofences.png
https://github.com/ginppian/borrar/blob/master/nv-device_geofence.png
https://github.com/ginppian/borrar/blob/master/nv-vps.png
Please read documentation more careful!!! The endpoint is /api/permissions
, not /api/permission
.
Excuse me bro i'm a little fool. I share the process for somebody else:
https://github.com/ginppian/borrar/blob/master/r-auth.png
https://github.com/ginppian/borrar/blob/master/r-header.png
{
"id": 1,
"name": "Agenda",
"description": "Es una prueba de la agenda",
"area": "CIRCLE (19.045129480045105 -98.23004848937367, 163.6)",
"calendarId": 0
}
we don't write attributes because we want to send these like NULL.
https://github.com/ginppian/borrar/blob/master/r-api.png
https://github.com/ginppian/borrar/blob/master/r-body.png
A basic tuto:
Bro AT&T modify Traccar and put it as their property, they are selling your plataform and your app in México
Proof?
Why @QueryIgnore, excuse me:
@QueryIgnore public long getPositionId() { return positionId; } public void setPositionId(long positionId) { this.positionId = positionId; } private long groupId; public long getGroupId() { return groupId; } public void setGroupId(long groupId) { this.groupId = groupId; } private List<Long> geofenceIds;