SPO REST API: How to retrieve items in a List folder

Copper Contributor

Hi,

This seems crazy but I can't seem to figure out how to retrieve Items in a List folder with REST.

As you know, SP Lists can have folders, but how to retrieve Items in a specific List folder.

Say I have this conf:

ListX

-FolderA

--Item1

--Item2

-FolderB

--Item3

--Item4

 

How do I retrieve Item1 & Item2 knowing FolderA?

The question has been asked a lot on stackoverflow, answers are there but nothing seem to work...

MS really needs to provide good documentation for SPO. This is beyond frustrating.

I have tried:

_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')/Items

_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')?$expand=Folders,Files,Items

_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')/ListItemAllFields

You can replace GetFolderByServerRelativePath with GetFolderByServerRelativeUrl as well, I tried all with many others...

None is working.

 

Does anyone know what works with SPO (SharePoint Online)?

0 Replies