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

%3CLINGO-SUB%20id%3D%22lingo-sub-297879%22%20slang%3D%22en-US%22%3ESPO%20REST%20API%3A%20How%20to%20retrieve%20items%20in%20a%20List%20folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297879%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EThis%20seems%20crazy%20but%20I%20can't%20seem%20to%20figure%20out%20how%20to%20retrieve%20Items%20in%20a%20List%20folder%20with%20REST.%3C%2FP%3E%3CP%3EAs%20you%20know%2C%20SP%20Lists%20can%20have%20folders%2C%20but%20how%20to%20retrieve%20Items%20in%20a%20specific%20List%20folder.%3C%2FP%3E%3CP%3ESay%20I%20have%20this%20conf%3A%3C%2FP%3E%3CP%3EListX%3C%2FP%3E%3CP%3E-FolderA%3C%2FP%3E%3CP%3E--Item1%3C%2FP%3E%3CP%3E--Item2%3C%2FP%3E%3CP%3E-FolderB%3C%2FP%3E%3CP%3E--Item3%3C%2FP%3E%3CP%3E--Item4%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20do%20I%20retrieve%20Item1%20%26amp%3B%20Item2%20knowing%20FolderA%3F%3C%2FP%3E%3CP%3EThe%20question%20has%20been%20asked%20a%20lot%20on%20stackoverflow%2C%20answers%20are%20there%20but%20nothing%20seem%20to%20work...%3C%2FP%3E%3CP%3EMS%20really%20needs%20to%20provide%20good%20documentation%20for%20SPO.%20This%20is%20beyond%20frustrating.%3C%2FP%3E%3CP%3EI%20have%20tried%3A%3C%2FP%3E%3CPRE%3E_api%2FWeb%2FGetFolderByServerRelativePath(decodedurl%3D'%2Fsites%2Fsomesite%2FLists%2FListX%2FFolderA')%2FItems%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E_api%2FWeb%2FGetFolderByServerRelativePath(decodedurl%3D'%2Fsites%2Fsome%3C%2FSPAN%3E%3CSPAN%3Esite%3C%2FSPAN%3E%3CSPAN%3E%2FLists%2F%3C%2FSPAN%3E%3CSPAN%3EListX%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3EFolderA%3C%2FSPAN%3E%3CSPAN%3E')%3F%24expand%3DFolders%2CFiles%2CItems%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E_api%2FWeb%2FGetFolderByServerRelativePath(decodedurl%3D'%2Fsites%2Fsomesite%2FLists%2FListX%2FFolderA')%2FListItemAllFields%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3EYou%20can%20replace%26nbsp%3B%3CSTRONG%3EGetFolderByServerRelativePath%3C%2FSTRONG%3Ewith%26nbsp%3B%3CSTRONG%3EGetFolderByServerRelativeUrl%3C%2FSTRONG%3Eas%20well%3CSTRONG%3E%2C%20%3C%2FSTRONG%3EI%20tried%20all%20with%20many%20others...%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ENone%20is%20working.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EDoes%20anyone%20know%20what%20works%20with%20SPO%20(SharePoint%26nbsp%3BOnline)%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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