Use the Graph API to get an empty list of Sharepoint files

Wei Tan 20 Reputation points
2024-04-21T12:58:45.5+00:00

My Application account has applied Graph and Sharepoint Sites.Selected permissions, and the administrator has agreedapplication api permission

Sharepoint Site has configured app permissions

sharepoint site application regist

I can use the Graph API to access Sharepoint Sites and drives

site drive

But get the root folders and files returns an empty list ,Is my permission insufficient?

I'm referring to this document: https://marczak.io/posts/2023/01/sharepoint-graph-and-azure-sp/

In his documentation example, he can get folders and files, but I can't

empty file

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. William Ramirez 76 Reputation points
    2024-04-22T01:15:38.52+00:00

    Sharepoint is deprecating ACL. Please Validate that permissions were assigned properly read/write in the Sharepoint Site that has configured app permissions.

    If not, permissions were assigned. Please ask to add permission read or write permissions to service principal using Permissions API or PnP are my recommended way due to sites.selected. Example:

    1. via Graph API /sites/{siteId}/permissions endpoint
    2. Grant-PnPAzureADAppSitePermission -AppId "yourAppID-75a7-47e3-bdb6-b763851c61b6" -DisplayName "TestApp" -Permissions FullControl -Site https://contoso.sharepoint.com/sites/projects https://pnp.github.io/powershell/cmdlets/Grant-PnPAzureADAppSitePermission.html

0 additional answers

Sort by: Most helpful

Your answer

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