I am trying to retrieve the users of a SharePoint group via the REST API. First I use this URL https://tenant.sharepoint.com/sites/SiteXY/_api/web/sitegroups/ to get all the SharePoint groups of the site. This works just fine with my app-only token, which has the role "Sites.FullControl.All".
Now I want to get the members of one of the groups by using "https://tenant.sharepoint.com/sites/SiteXY/_api/web/sitegroups/GetById(id of the group)/Users" And here I get "-2147024891, System.UnauthorizedAccessExceptionAttempted to perform an unauthorized operation."
What am I doing wrong here? I can open this URL in a web browser as a normal user of the SharePoint site and I get the xml result.
Thanks for your help!