i wish to make link or add a user to particular group and category via rest api call ? whether is it possible.suggest some ideas.
You can add a user to a group through a POST to /admin/users/USER_ID/groups. Include the group_id as a param.
You can remove a user from a group through a DELETE to /admin/users/USER_ID/groups/GROUP_ID.
thanks bro…how to get the specific group details … get method admin/groups/group_id or something else
2.is it possible to add users in to group with email as param…
3.to get the specific user details through user_id…
I’ve been working on exactly this problem and found that this worked:
- Get list of groups and their IDs with
- Get a user’s username with
-d filter=email%40domain.com /admin/users/list/active.json
- Now you have the group ID and the username, you can add the user to the group with
PUT -d usernames=username /admin/groups/GroupIdGoesHere/members.json
- And remove the user from the group with
DELETE -d username=username /admin/groups/GroupIdGoesHere/members.json
Note that the PUT command will accept a comma separated list of usernames, but the the DELETE command will only do one member at a time.
thanks tom: but i asked to get the specific group details through group_id like this:
admin/groups/group_id is it correct one? else any changes needed?