How can I get permissions from SharePoint site using MS Graph

Adrian Corral Ruiz 20 Reputation points
2024-10-02T05:54:13.2166667+00:00

I am looking to see how I can get a list of SharePoint sites and then, get their permissions using the Graph API. I know that it could be done with SP Rest API, but I'm more interested in Graph.

I tried to get the permissions of one of my sites in my dev tenant, but I'm getting an empty array. I'll explain what I configured:

  • Azure App Registration with Graph -> Sites.FullControl.All api permission granted with admin consent. I have a secret created too. User's image
  • Then I made a POST request to get the Bearer token to get next steps User's image
  • Later, I made a GET request to get a list of sites in my tenant and worked successfully User's image
  • Finally, I'm trying requesting the permissions, but an empty array is returned: User's image

I tried to put only the id, the entire id, and more combinations, but this output is the same.

Any help would be appreciated!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,229 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,027 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xyza Xue_MSFT 25,461 Reputation points Microsoft Vendor
    2024-10-02T07:26:50.6766667+00:00

    Hi @Adrian Corral Ruiz ,

    Thank you for posting in this community.

    /sites/{sitesId}/permissions: Use this method to obtain application permissions; not site user permissions.

    The default return value is an empty array, unless you have previously created permissions.

    User's image

    User's image

    If you are trying to get Site Collection Permissions Report, there is no graph api for that, you can get it through powershell. If that's not your intention, forgive me for misunderstanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.