I've got a document library which has folders in it. I can get a given folder and iterate through the documents in the folder via REST just fine. What I need to do is get some of the list item properties (CreatedBy, ModifiedBy, Modified date) for each of those files.

I understand that what I need to do is to query the file as if it were a list item, using:


But I'm not seeing any way to get that list item ID for that file.

3 Answers 3


Try this:


It should work.



  • Doesn't that return all items? I need to get the ID of the specific item for the file in question I already have. Feb 14, 2019 at 14:54
  • You can add filter attribute to filter the query, for example if you would like to filter by ID of 4 then you can use below REST query. "/_api/web/lists/getByTitle('Documents')/items?$select=ID&$filter=ID eq '4'" Feb 14, 2019 at 15:27
  • That's the problem- I've got the file, not the list item, so I need to get the ID of the list item the file is attached to. Feb 14, 2019 at 19:42
  • In that case you can use any other associated field whose value you know. for example to filter based on title of the document you can use below REST query. "/_api/web/lists/getByTitle('Documents')/items?$select=ID&$filter=title eq 'documenttitle'" Feb 15, 2019 at 1:36

CreatedBy and ModifiedBy are SP.People fields. So you need to use expand in your query.

https://<siteURL>/_api/web/GetFolderByServerRelativeUrl('/FolderRelativePath')/Files('<File Name>')?$select=Author/Title,Editor/Title&$expand=Author,Editor

FolderRelativePath : '/sites/sitename/RootFolderName/SubfolderName'

Author: internal name of the 'Created By' column

Editor: internal name of the 'Modified By' column

Hope this helps



Consider the file as an item then pass the file at the end of restApi endpoint:



type: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data){
error: function (err){

Good luck

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.