I want to see the list of users and teams to which a record is shared. I only want to see the list of users and teams that are given access to a record through the share button and not through the security role.
I am aware of the RetrieveSharedPrincipalsAndAccessRequest function. But, I don't want to write a plugin or create a custom action.
My question is how can I use the 'RetrieveSharedPrincipalsAndAccessRequest' function as a REST API?
The PrincipalAccessObject table holds the sharing data and you can query it.
E.g. by using FetchXml:
The access rights mask is a flag enum. Documentation on it can be found on MS Learn.