2

I have been trying to make a call to a specific subfolder. Oddly if I call directly to:

'sites/website/RootFolder/Folders(\'subfoldername\')/Files

It returns the subfolder items but it won't give me additional columns like Category or Author.

I can get all the data by doing a regularly api call but it gives me all folders. I need to filter it to one folder but I am not sure what column type to select for this?

The call I am doing but don't see the "folder" names?

    var sel='FileLeafRef,File_x0020_Type,Category,Category0,OData__Author,Folder,File,ContentType';
    var url=pth+'/_api/Web/Lists/GetByTitle(\'Library\')/items?$select='+sel; 
2
  • Have you tried _api/Web/GetFolderByServerRelativeUrl('/Shared%20Documents/FolderA/Subfolder1')/Properties Dec 29 '20 at 20:25
  • also you can get folder name using this /_api/web/Lists/GetByTitle('Library')/Items?$expand=Folder&$select=Title Dec 29 '20 at 20:26
1

You could add filter in the end of rest api like this:

&$filter=FileLeafRef eq 'FolderName'

For example:

/_api/Web/Lists/GetByTitle('Documents')/items?$select=FileLeafRef,File_x0020_Type,Category,Category0,OData__Author,Folder,File,ContentType&$filter=FileLeafRef eq 'Folder1'

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.