accessing sharepoint sites using graph api

    IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
    ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);

    GraphServiceClient graphClient = new GraphServiceClient( authProvider );
    //To access the root SharePoint site:
    var site1 = await graphClient.Sites["root"]
    //To access the Specified SharePoint site:
    var site2 = await graphClient.Sites["{site-id}"]

And as @Shiva- MSFT Identity said, please add the Application permissions Sites.ReadWrite.All under the MicrosoftGraph Permissions but not under the Sharepoint Permission.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top