Access requirements to call Endpoint: https://XXX.sharepoint.com/sites/PermissionTest/_api/web/roleassignments?$expand=Member/users,RoleDefinitionBindings,Member

Joel Outry 0 Reputation points
2025-02-20T11:59:05.27+00:00

Hi team

I need to call an endpoint using PowerQuery to extract current permissions. I have service user for that purpose but I am unable to set up the permissions so that the endpoint can be queried.

I am able to get all sharepoint sites, however when trying to get to the Permissions, the authorization is refused.

Thanks for the help!

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,324 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 50,411 Reputation points Microsoft Vendor
    2025-02-21T07:37:07.31+00:00

    1.Azure Active Directory Permissions:

    If you're using an Azure AD application to authenticate, go to Microsoft Entra admin center -> Applications -> App registrations -> Select your App -> API permissions -> Add following permissions.

    (1)Sites.FullControl.All: Grants full control over all site collections.

    (2)User.Read.All: Allows the application to read all users' full profiles.

    After adding these permissions, make sure to grant admin consent to apply them.

    2.SharePoint permissions:

    If you're using SharePoint created application to authenticate, use appregnew.aspx and appinv.aspx to create the app and grant it full control permission.

    Then get a bearer token using a client credential in Postman.

    Reference:

    https://www.billyperalta.com/Accessing%20SharePoint%20REST%20API%20using%20Postman/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    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 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.