I have a SharePoint site that has many different Document Libraries. Each Document Library has unique permissions.
I can't seem to use the SharePoint REST API to get the email addresses of the users who have access to each Document Library. I tried /_api/lists/getbytitle()/RoleAssignments , but it gives me users who were assigned to other Document Libraries as well. For example, User Alice has been assigned to Document Library 1 , but not Document Library 2. When I do /_api/lists/getbytitle('Document Library 2')/RoleAssignments, somehow I have an entry for Alice as well, even though Alice has no permissions for Document Library 2.
I have a Java program that seeks to send email notification to all users who have access to a Document Library when certain specific changes happen to that particular Document Library.