New APIs: assignRole and removeRole for Site Members

Up until now, you could manage access of site members to restricted pages only through the Site Members UI in the Business Manager. Now, you can do this also programmatically!

We’ve exposed two new APIs — assignRole() and removeRole() — to achieve this. You can find these new APIs in the new Roles subnamespace in wix-users-backend. Learn more

Yesss! Awesome news.

hi thank you, how can I add more then one role to a member?

You’ll need to call the API multiple times (we don’t support bulk for this API at the moment).

Any insights on how to trigger this assign role API after an event ticket is purchased?
We are trying to accomplish this logic:
if event=VIP, after order is confirmed, assign role VIP,
else if event = GEN, after order is confirmed, assign role GA,
else do nothing.

We are trying to figure out how to insert the role assign API after the event order confirmation. Any insights will be greatly appreciated.

I have similar requirements. Did you find out?

How do I get the list of roles of a specified member other than the currently logged in member