Bulk Add Users to Group Hubs via API Calls?
Is there any way to programmatically bulk add users to multiple group hubs using API calls?Ideally, I'd like to take a CSV data with columns "group_hub_id, user_id, role" and iterate over it, adding each user to the group if they aren't already in that group, but I don't see a direct way to do that.
So far, all I've found would be to either manually upload a CSV through the admin for each group (which would involve more manual work) or possibly to use the existing API calls to invite a user and then accept the invitation on their behalf (which seems tedious and the user shouldn't be notified that this process is taking place, and perhaps isn't even possible).
There are other steps we'd automate into this process, but this would be the first step, and without it, the rest of the process is blocked.
Any ideas?
Thanks,
Matthew
Hi mkuehnkhoros
Some good news on this, you can actually do this, but you have to bypass the membership API in v2.
You essentially need to call the APIv1 endpoint and add users i.e:
https://yourcommunity.com/restapi/vc/roles/id/<roleid>/users/add?role.user=id/<userid>&restapi.session_key=<apiKey> you can use other varients of this but in my example above lest assume we want to add user 52 to the owner role for Group Hub MyHub, which has a role id of 216. You would make a post call like this: https://yourcommunity.com/restapi/vc/roles/id/216/users/add?role.user=id/52&restapi.session_key=dkldjlkfjgdlkfjdflkjg4989438u