1

I'm trying to make a HTTP Web service call using SharePoint Designer 2013. The URL I'm using is

https://<site url>/_api/web/lists/getbytitle(My List)/items?$select=id,Created,Author/Id&$expand=Author/Id

However, this returns 0 items. If I use

https://<site url>/_api/web/lists/getbytitle(My List)/items?$select=id,Created

this works fine. But as soon as I add Author, it doesn't return anything. How should the url be like for this work? Thanks.

2 Answers 2

1

I managed to find the issue. Instead of using Author as a Lookup field I just needed to use AuthorId as normal field. So the url is like

https://<site url>/_api/web/lists/getbytitle(My List)/items?$select=id,Created,AuthorId

This returns the correct result.

1
https://<site url>/_api/web/lists/getbytitle('ListName')/items?$select=Author/Title&$expand=Author

Since Author is of type user which is stored as User id in the column when used with expand function it retrives Title of the Author, you can also use ID, FirstName,LastName,LoginName as required.

2
  • Hi Shiva, thanks for the answer. I will try this out. If this works, this'd be better as it gives a way to access other attributes of 'Author'.
    – kovac
    Commented May 16, 2016 at 9:44
  • Can you provide some information as to why this is the answer? Answers should not only provide a solution, but explain the solution, so that others can learn from it.
    – wjervis
    Commented May 16, 2016 at 12:00

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.