Share via

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

Patil, Vinod V 50 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 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph

Answer accepted by question author

  1. Emily Du-MSFT 51,986 Reputation points Microsoft External Staff
    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

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.