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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,644 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,678 questions
0 comments No comments
{count} votes

Accepted answer
  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