I've got a problem with SharePoint Rest API.
I've got a service account with "Full control" permission level.
I need to list all group members in my site collection.
I can run:
https://mytenant.sharepoint.com/_api/web/sitegroups
It returns my groups in the site collection, but does not have their group memberships which I need.
So I try the following, but I get blocked trying:
https://mytenant.sharepoint.com/_api/web/sitegroups?$expand=Users
"value": "Access denied. You do not have permission to perform this action or access this resource."
I am, however, able to get the members of each group individually. Example:
https://mytenant.sharepoint.com/_api/Web/SiteGroups/GetById(6)/UsersIs this an oversight on Microsoft's side? I cannot list all groups and their members without being an administrator?
This is now going to force me to do NumGroups extra API requests on SharePoint which isvery costly for me in terms of rate limiting.