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
Dave Dyson (gmail)
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
karan sharma
0