SharePoint Graph API - access subfolders not under default Shared Documents folder for a site

Patil, Vinod V 40 Reputation points
2024-04-15T21:35:43.6766667+00:00

We are able to access the folders/subfolders under the default "Shared Documents" folder for a site using below sites URI https://graph.microsoft.com/v1.0/sites/site_id/drive/root/children https://graph.microsoft.com/v1.0/sites/site_id/drive/root:/folder_name.

But there are few sites for which we have folders at the same level as "Shared Documents" which we are not able to access using sites URIs. Could you please suggest any way to access those?

e.g.

https://xyzabc.sharepoint.com/sites/globalfin/Shared%20Documents -- we could access https://xyzabc.sharepoint.com/sites/globalfin/Fixed%20Asset%20Reports -- we could not access these, how can we accessed these?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,633 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,671 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 41,791 Reputation points Microsoft Vendor
    2024-04-16T07:53:45.2333333+00:00

    Whether Fixed Asset Reports is a custom document library?

    Here are steps to get a folder by Graph Api.

    1.Get the custom document library id.

    https://graph.microsoft.com/v1.0/sites/{siteid}/drives

    2.Get the id of folder in the document library.

    https://graph.microsoft.com/v1.0/sites/{siteid}/drives/{driveid}/root/children


    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful