I'm trying get SiteGroup/Users from Sharepoint Online, by calling this REST API: /_api/web?$expand=webs,lists,AllProperties,ThemeInfo,SiteUsers,SiteGroups,SiteGroups/Users,RoleDefinitions&$select=*
While on some customers sharepoint sites it's works fine , on other it's failing with :
{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":
{"lang":"en-US","value":"Access denied. You do not have permission to perform
this action or access this resource."}}}
When I remove SiteGroups/Users it's working fine, but I need SiteGroups/Users. In both cases user that I'm accessing with is Site collection Admin. So, I'm trying to understand what can be difference between admins that in one case works fine but in another not. Thanks