I could not find the right SharePoint API which will provide below information from a file.

Files Attributes

I am getting name and Title by using below API calls:

https://<tenant_id>/_api/web/Lists/GetByTitle('<directory name>')/Items?$select=FileLeafRef,FileRef,ID, Title,Created,Modified,Editor/Title,File_x0020_Type&$expand=Editor&$top=50000

I want Content Owner and others fields along with name and title. Thanks!!


Try this, it should work for you:

_api/web/Lists/GetByTitle('<directory name>')/Items?$select=FileLeafRef,FileRef,ID,%20Title,Created,Modified,Editor/Title,Content_x0020_Owner/Title,File_x0020_Type&$expand=Editor,Content_x0020_Owner&$top=50000`
  • Thanks, @Sandro!! It works Aug 27 '20 at 12:04
  • Hi @Sandro - Could you please tell me how do you know this is the exact name I have to put ina select statement in order to pull data. I need to pull some other columns as well. Thanks!! Aug 28 '20 at 6:26
  • @Dipak Use _api/web/Lists/GetByTitle('<directory name>')/fields to get all available fields. You can check a specific field using the following command _api/web/Lists/GetByTitle('<directory name>')/fields$filter=Title eq '<fieldtitle>'. This will return the property TypeDisplayName. If it is "Person or Group" use this link to get all expandable properties. If it is "Lookup" you have to check the properties in the lookup list
    – Sandro
    Aug 28 '20 at 8:30

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.