Retrieving SharePoint Page Permission Details via Microsoft Graph API

Kanaghappriya Karunanithi 10 Reputation points
2024-11-19T07:14:02.2966667+00:00

For a GENAI project, we are working on retrieving content from a SharePoint page using the Microsoft Graph API (https://developer.microsoft.com/en-us/graph/graph-explorer). We have found a URL to get the page content. However, we have not found a URL to retrieve the permission details. Specifically, we are looking for a way to get the "Manage Access" section through a GET request in the Microsoft Graph API. Could anyone share their ideas to get the permission details ?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ki-lianK-7341 1,010 Reputation points
    2024-11-19T07:34:27.8033333+00:00

    To get permission details for a SharePoint page using Microsoft Graph API, use these endpoints:

    Site Permissions:

    GET /sites/{site-id}/permissions
    

    List Item Permissions:

    GET /sites/{site-id}/lists/{list-id}/items/{item-id}/permissions
    

    Drive Item Permissions:

    GET /sites/{site-id}/drive/items/{item-id}/permissions
    

    Ensure you have the necessary permissions like Sites.Read.All or Sites.ReadWrite.All


  2. Anonymous
    2024-11-19T07:50:19.7133333+00:00

    Hello Kanaghappriya Karunanithi,

    Thank you for reaching out to Microsoft Support!

    You can obtain permissions using the following endpoints:

    GET /sites/{sitesId}/permissions
    

    Reference document:

    https://learn.microsoft.com/en-us/graph/api/site-list-permissions?view=graph-rest-1.0&tabs=http

    Hope this helps.

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


  3. Hitesh Pachipulusu - MSFT 3,620 Reputation points Microsoft External Staff
    2024-11-19T10:29:23.8+00:00

    Hello Kanaghappriya Karunanithi,

    Thank you for contacting Microsoft Support!

    To retrieve the permission details of a SharePoint page using the Microsoft Graph API, you can use the following endpoint:

    GET /sites/{site-id}/permissions
    

    This endpoint will list the permission resources from the permissions navigation property on a site. Here’s a step-by-step guide to help you get started:

    1. Get the Site ID: You can retrieve the site ID using the following endpoint:
         GET /sites/{hostname}:/{server-relative-path}
      
    2. Retrieve Permissions: Use the site ID to get the permissions:
         GET /sites/{site-id}/permissions
      

    Here’s an example of how the request might look:

    GET https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
    

    This will return a list of permissions for the specified site, which you can then parse to get the details you need.

    Hope this helps.

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

    0 comments No comments

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.