You are not logged in.
Pages: 1
I am trying to use the API to put a particular user into a particular group. The first problem I have is getting the id for a single user. Is there a way to do this if I have the users username. I know I can get a list of all users with Users.getAllUsers but that does not contain userNames (just userDescriptions).
Is there actually an API method that will add a user to a particular group? (I tried ApplyUserPreset using the name of a group, but that does not work).
The idea behind this is that we use LDAP and when a user logs in for the first time, we have no control of the group they will go into. We would like to run a routine to move the users to whichever group they need to be in.
Can this be done?
Offline
Yes, this can be done - the syntax is g:<group ID>; you can make a call to Users.GetAvailableUserPresets to get a list of available presets and groups (where the IDs are in the correct format).
Dominic
Offline
Great! That was a very quick reply. Thank you.
Works perfectly.
Is there another way to get the userID from a username for a single user?
Offline
There isn't a convenient way to get the user ID from a username, but in most cases you can pass the username itself in API requests.
Offline
Pages: 1