1

I am starting to make use of REST queries in our SharePoint 2010 environment. One thing that has been consistent is that the query never returns the "Created By" column value, internally known as the "Author" column. An attempt to explicitly include $select=Author dies. An attempt to use $select=* returns <author> <name /> </author> in the raw returned XML.

I am suspecting this is a baked-in bug or intentional exclusion, as a look at "Using the REST Interface" at https://msdn.microsoft.com/en-us/library/Ff798339.aspx shows their own example return results containing only <author> <name /> <author> for the Author information.

Oddly enough, the "Modified By" info is available in a column "ModifiedById", which returns the numeric ID of the editor.

My REST queries are originating from a separate non-SharePoint system. I have tried executing them using users who have "Full Control" rights on the site being REST queried, fiddled with various List Settings settings, etc.

Is it possible to get the Author column info returned in a SP2010 REST query? I'd be ok with their numeric ID, but right now, nothing is returned.

2

The following examples demonstrates how to return Author user field value via SharePoint 2010 REST interface:

  • How to get Author user field id: /_vti_bin/listdata.svc/List?$select=CreatedById
  • Use $expand query option to return Author field details (projection to User Information list): /_vti_bin/listdata.svc/List?$select=CreatedBy&$expand=CreatedBy
  • Tried both. Neither work for me. I actually tried the "CreatedById" on speculation early on, and it fails. So does "CreatedBy". If I take out the "CreatedBy" or "CreatedById", it works, but of course does not return the desired column. I don't know if this matters or not, but the list is a Calendar list. Perhaps this something that is fixed by applying a cumulative update, who knows? – Alan M Sep 2 '15 at 21:22
  • 2
    @AlanM something may be wrong with your list definition... ?$expand=CreatedBy is the technique specified by the API and docs and works for all the lists in my on prem environment and O365 environments – John-M Sep 3 '15 at 12:59
  • Right you are! I created a brand new "Calendar" type list, and added my custom content type to it. The numeric CreatedById was then supplied, and using the REST queries shown by Vadim G. above, I was able to retrieve author info. I'd mark your comment as the answer too if I could, but the best I could do was to upvote it. – Alan M Sep 9 '15 at 21:23

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.