0

I need to get all the items in a specific folder in a list. I have tried few api like but it does not give me items in list. I need to get items so that I can get total length of folder.

/_api/web/GetFolderByServerRelativeUrl('Lists/Location_Ref/FolderLocation')/

What is missing in this api?

3 Answers 3

0

try this one https://server/_api/Web/GetFolderByServerRelativeUrl(<folder url>)?$expand=Files

1
  • Please explain along
    – Gaurravs
    Commented May 23, 2017 at 12:47
0

try this It will give all the folders and Files

  var folderUrl = '/documents/2015';
    var url = _spPageContextInfo.webServerRelativeUrl + "/_api/Web/GetFolderByServerRelativeUrl('" + folderUrl + "')?$expand=Folders,Files";

It will give all the files

var folderUrl = '/documents/2015';
var url = _spPageContextInfo.webServerRelativeUrl + "/_api/Web/GetFolderByServerRelativeUrl('" + folderUrl + "')?$expand=Files";

Check this Link:

Get all Files and Folders in one call

1
  • I have tried this already, but when i do data.d.results.length, this does not give me the total number of items in that folder
    – KumarV
    Commented May 23, 2017 at 15:30
0
http://SITE/_api/web/GetFolderByServerRelativeUrl('Lists/Location_Ref/FolderLocation')/Files

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.