Thank you for the idea, I’ve tried this code and did successfully get a 200 response; however, this didn’t actually add the user to the role so unfortunately didn’t achieve what I am trying to do.
Ideally trying to have a API call that I can add and/or remove people from roles.
Also odd that when I now run a call to get the role, it seems the Identity is there but the object looks empty. Nothing in the UI to imply the user has the role either? Maybe I need to wait a while for it to update or something?
Using the replace syntax did work in the end, the UI took quite long time to reflect the change… Which is a real shame because it delays access management.
However, the replace operation isn’t quite what I’m after, I’m trying to remove or add people to the list.
Even when I change the ‘replace’ op to ‘add’, it still seems to replace the identities… Any ideas on how to do an add or remove rather than a full replace?
Thanks Tyler, this is exactly what I was after. Looks like I needed to update my path and add an additional curly bracket inside of the value to get a 200 response.
The duplicates should not be allowed. I will raise a ticket with the team to dig into that further.
To remove you must know the index at which the identity you want to remove is at. For example, if you wanted to remove the first identity in the list, you could use the patch structure below.
Thank you for this, I can confirm this has worked and successfully removed the user.
Do you know if the pathing is limited via hardcoding to the position of the identity in the list? For example, say if I have 50 users and would like to remove an identity. Would I need to identify the position they appear against the role? EG: /membership/identities/23
Additionally, I have noticed that when we add users to the list using ID, when I get info about the role, they appear in the response but not in the UI?