Hello!
I have several devices grouped using Groups.
The devices and groups have my private attributes, such as ProtocolVer, SMSCenter, MailServer, etc.
I use API/DEVICES?uiniqueId=.... to retrieve device attribute information.
But for convenience, the group attributes are the same, so I don't have to specify all the attributes for each device each time.
Then, I get the group attributes using API/GROUPS the hard way:
I load all the groups and find the group with the ID obtained from API/DEVICES?uniqueID=
API/GROUPS has a userId, but it only works for the device owner, as I understand it, under their account.
The problem is that I need my shared server to handle this processing and make decisions based on the attributes.
Is it possible to make API/DEVICES/userID work not only for the device owner, but also for the account that has access rights to their devices?
PS.
Currently, I have to first download data for all groups, and only then select the groups and their data that have groups assigned to the uniqueID in API/DEVICES.
Too much unnecessary traffic
So, now Im tested the /api/groups?userId=... when I used Basic Auth method with server's account with grand priveleges. And it is worked.
Where is the problem in doc's description https://www.traccar.org/api-reference/#tag/Groups
"integer Standard users can use this only with their own userId"
or it is a bug in traccar's API that is works now as I need?
Sorry, I misled you. I use uinqueId (in api/devices?uniqueId=...) to get the device's group ID, and then use it to get the group's attributes from the loading and parsing list of all data all groups (by api/groups)
I need to use simple API/GROUPS?id=..... , where id - is ID of the group. Or list of groups assigned to the device.
So you resolved your problem?
Hello!
I have several devices grouped using Groups.
The devices and groups have my private attributes, such as ProtocolVer, SMSCenter, MailServer, etc.
I use API/DEVICES?uiniqueId=.... to retrieve device attribute information.
But for convenience, the group attributes are the same, so I don't have to specify all the attributes for each device each time.
Then, I get the group attributes using API/GROUPS the hard way:
I load all the groups and find the group with the ID obtained from API/DEVICES?uniqueID=
API/GROUPS has a userId, but it only works for the device owner, as I understand it, under their account.
The problem is that I need my shared server to handle this processing and make decisions based on the attributes.
Is it possible to make API/DEVICES/userID work not only for the device owner, but also for the account that has access rights to their devices?
PS.
Currently, I have to first download data for all groups, and only then select the groups and their data that have groups assigned to the uniqueID in API/DEVICES.
Too much unnecessary traffic