Recent searches


No recent searches

Adding many users to groups via API



Posted Feb 03, 2023

In the below statement for group membership via API.Can we also add email of the user instead of user_id and how it can achieved?
 
-X POST -d '{"group_memberships": [{"user_id": 72, "group_id": 88}, {"user_id": 73, "group_id": 88}]}' \
-H "Content-Type: application/json" -v -u {email_address}:{password}
 
Please help !

 

 
 

0

2

2 comments

image avatar

Dave Dyson (gmail)

Community Moderator

Hi Karan, I think you'd need to use the Search Users API endpoint, with the email address as the query, e.g. query="email:jdoe@example.com" in order to return the user record for each user, which would include that user's user id. You could do that for each user you want to look up, and collect the user ids for use in the Create Many Group Memberships API endpoint you want to use above.

 

0


Since this is the only way to add many users to group how can we also place email id of the user what will be the format?
 
 
 
-X POST -d '{"group_memberships": [{"user_id": 72, "group_id": 88}, {"user_id": 73, "group_id": 88}]}' \
-H "Content-Type: application/json" -v -u {email_address}:{password}

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post