How do I use the SharePoint REST API to list the contents of a folder in a document library?


There's a little bit of setup to get the correct folder. First, use the REST API to get the list of items inside of the document library.

https://contoso.sharepoint.com/_api/web/Lists/getByTitle('Shared Documents')/files

Based on the result, search for the entry with the folder name in the <name> element that is directly under the <entity> element (the other name elements are for user info and such). The ID of the record will take you to the detailed description of that item.


Append /childen to the end of the query to get the list of files and folders in under the selected folder.

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.