0

I have a folder in a document library and that contains subfolders and each subfolder contains files.

I want to retrieve all the files in these subfolders using REST. Any help?

0

You can use an endpoint like this /_api/web/lists/getbytitle('Documents')/items?$expand=File&$select=File&$filter=ContentType ne 'Folder'

It will list all files under the library.

0

This endpoint solved my problem:

_api/Web/GetFolderByServerRelativeUrl('/Library Name/Folder Name/')?$expand=Folders,Folders/Files

For more information, check this article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.