5

I'm trying to retrieve all the documents in a document set using REST.

If I use the Lists/GetByTitle(''). I'm able to retrieve an individual item and some associated metadata like so:

~site/_api/web/Lists/GetByTitle('ManagementLibrary')/Items(475)
 ?$select=ID,Title,FLSequence,LSTeaser

But I don't see any way to retrieve all the items in a folder/documentset. (My understanding is that docsets are just fancy folders as far as SP is concerned). So in that case I'm following this documentation to get all the files in a folder. In this case I'm just trying to get the same resource (item 475 is Interviewing Information) to keep it simple.

~site/_api/web/GetFolderByServerRelativeUrl('/teams/lscsp-cat10/ManagementLibrary/ZCKNDY7XXYKP-15-3/')/Files('Interviewing Information.aspx')
?$select=ID,Title,FLSequence,LSTeaser

That does retrieve the correct item, but the only piece of metadata I get is Title. ID and the others (which are user defined) don't show up.

Any idea what is going on here?

3

You're retrieving the File Object, which only has 'Properties'. Metadata is defined on the Item.

To view the Properties on that File, try adding '/Properties' to the end of the Query.

To view the Metadata associated with the Item, try adding '/ListItemAllFields' to the end of the Query.

i.e.:
~site/_api/web/GetFolderByServerRelativeUrl('/teams/lscsp-cat10/ManagementLibrary/ZCKNDY7XXYKP-15-3/')/Files('Interviewing Information.aspx')/ListItemAllFields

2

You might need to take a look at expanding the deferred call for ListItemAllFields. I had a similar situation and my call looked like this

site/_api/web/GetFolderByServerRelativeUrl('/teams/lscsp-cat10/ManagementLibrary/ZCKNDY7XXYKP-15-3/')Files?$expand=ListItemAllFields

Marc D Anderson's Blog - Get all SharePoint Document Library Files and Folders

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.