Get Group data by userId not only for own user

ELSE 21 days ago

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

ELSE 21 days ago

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?

ELSE 21 days ago

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.

Anton Tananaev 20 days ago

So you resolved your problem?

ELSE 20 days ago

No. I need api/groups?id=... for get information about group by id group.
Now I getting list of all groups by api/groups, than parse the list to get group with my ID.

Anton Tananaev 20 days ago

There is already GET /api/groups/{id} available.

ELSE 20 days ago

Sorry, Do I something wrong?:

https://myserver.com/api/groups?id=1

and get all groups.
not only group with id =1

Anton Tananaev 20 days ago

Please carefully check my previous message again.

ELSE 20 days ago

Or thank you! it works.
Why it isn't described in API docs?

ELSE 20 days ago

I answer myself: because that's standard rule for REST API request format for single object.
Anton, sorry for wasting your time

Anton Tananaev 20 days ago

It is documented now.