question

Swati-8724 avatar image
0 Votes"
Swati-8724 asked 35247258 edited

MicrosoftGraph Api - unable to fetch all the subfolders from sharepoint document library

Below is document library structure in sharepoint. I need to get id of "sub-folder5" folder
DOCUMENTS --> sub-folder1 --> sub-folder2 --> sub-folder3 --> sub-folder4 --> sub-folder5

Using below request, I am able to fetch ID till only "sub-folder3" folder
https://graph.microsoft.com/v1.0/sites/{site ID}/lists/{ID}/items/{item id}/driveItem/children/

microsoft-graph-sites-lists
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered WendyLi-MSFT rolled back

HI @Swati-8724 ,

You could try to get the drive item with the path directly like this:

 sites/{site-id}/drives/{drive-id}/root:/{item-path}


For example: sites/{site-id}/drives/{drive-id}/root:/folder1/folder2/folder3/folder4/folder5


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.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Swati-8724,

I’m checking how the things are going on about this issue.

Please feel free to reply if there is any update.

0 Votes 0 ·

@Swati-8724 Have you tried Michael's suggestion? If you have any concerns about this thread, please free feel to reply.

============
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.



0 Votes 0 ·