How to add a new attribute to Event Forward

Carlos Colque 3 years ago

HI all.
I have updated the version of traccar to 5.7, before I had an adaptation for event forward for to see the user's data in json, but I have seen that the file it very diferent in this version, anybody know how to add or what the name file where could add that attribute?.
I would like this:

{"position":{"id":22055036,"attributes":{"alarm":"sos","ignition":true,"charge":true,"out1":true,"out2":false,"out3":false,"out4":false,"in2":false,"in3":false,"in4":false,"battery":4.1000000000000005,"power":12.0,"adc1":"0000","temp1":"0000","temp2":"0000","sat":0,"hdop":99.9,"odometer":0,"distance":0.0,"totalDistance":10.96,"motion":true,"hours":12980000},
 "deviceId":10806,"type":null,"protocol":"totem","serverTime":"2021-03-28T02:25:28.827+0000","deviceTime":"2021-03-28T02:25:28.000+0000","fixTime":"2021-03-28T02:25:28.000+0000","outdated":false,"valid":false,"latitude":-22.462153333333333,"longitude":-68.91801666666667,"altitude":0.0,"speed":1.079914,"course":0.0,"address":null,"accuracy":0.0,
 "network":{"radioType":"gsm","considerIp":false,
 "cellTowers":[{"cellId":16266,"locationAreaCode":2004,"mobileCountryCode":0,"mobileNetworkCode":0,"signalStrength":22}]}},
 "event":{"id":19457446,"attributes":{"alarm":"sos"},"deviceId":1806,"type":"alarm","serverTime":"2021-03-28T02:25:28.836+0000","positionId":22055036,"geofenceId":0,"maintenanceId":0},
 "device":{"id":10806,"attributes":{},"groupId":0,"name":"toten8739","uniqueId":"359888108128739","status":"online","lastUpdate":"2021-03-28T02:25:28.828+0000","positionId":22024023,"geofenceIds":[],"phone":"","model":"","contact":"","category":null,"disabled":false},
 "users":[{"id":1,"attributes":{},"name":"admin","login":"","email":"caxxxxxxxxxx@domain.com","phone":"+56980445853","readonly":false,"administrator":true,"map":"","latitude":-22.46012,"longitude":-68.923172,"zoom":15,"twelveHourFormat":false,"coordinateFormat":"","disabled":false,"expirationTime":null,"deviceLimit":-1,"userLimit":1,"deviceReadonly":false,"token":null,"limitCommands":false,"poiLayer":"","password":null},{"id":1084,"attributes":{},"name":"personal","login":"","email":"pnnnnonal","phone":"","readonly":false,"administrator":false,"map":"","latitude":0.0,"longitude":0.0,"zoom":0,"twelveHourFormat":false,"coordinateFormat":"","disabled":false,"expirationTime":null,"deviceLimit":2,"userLimit":0,"deviceReadonly":false,"token":null,"limitCommands":false,"poiLayer":"","password":null}]}

thank you for your help.

Anton Tananaev 3 years ago

The format is the same. Just no user info.

Carlos Colque 3 years ago

Hi,
correct, the previous version did not have the user. that was an adaptation. what I need to know is the file that the json creates

Carlos Colque 3 years ago

sorry, I have reviewed the old version and it not my adaptation, how could I add the user in the events forwarded? thanks.

Anton Tananaev 3 years ago

There's no easy answer. We removed it precisely because it was hard to implement.