I am new to using SharePoint online REST API's. I started with basics by connecting to SharePoint online via Postman and list folders in a subsite. So I have achieved the first step of connecting to SharePoint online via Postman by getting the access token. I am confused as to how to list folders inside a subsite.

So this is my site structure:

https://companyname.sharepoint.com/OM/Customer Invoicing

Here OM is the subsite and Customer Invoicing is the document library.

I want to construct the API URL to access the folders inside Customer Invoicing document library using a GET request.

I tried this:

https://companyname.sharepoint.com/_api/web/GetFolderByServerRelativeUrl(%27OM/Customer Invoicing')/Files

But I think I am doing it wrongly as I need to fetch folders from the document library in a subsite.


1 Answer 1


Try to modify Rest endpoint like this:

https://companyname.sharepoint.com/OM/_api/web/GetFolderByServerRelativeUrl('/OM/Customer Invoicing')/Folders

"OM/Customer Invoice" in GetFolderServerRelativeUrl needs to prepend "/" like "/OM/Customer Invoice":

enter image description here

  • Didn’t work. Why are you adding OM twice? Feb 7, 2021 at 16:20
  • OM is necessary to necessary to get sub site document library when working with GetFolderByServerRelativeUrl. Did the library name is "Customer Invoicing" really ? I tested the same endpoint in my side, it works as expected.
    – Jerry
    Feb 8, 2021 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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