retrieve all files in subfolders in sharepoint document library using REST

3.1k Views Asked by At

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. I know how to get the files in each folder but is there any way to get all these files in one REST call... Any help?

1

There are 1 best solutions below

0
Michael Han On

You could use the below endpoint to retrieve all files in a library:

/_api/web/lists/getbytitle('Documents')/items?$expand=File&$select=File&$filter=FSObjType eq 0