3

We are in the process of integrating from Sharepoint 2007 to Sharepoint 2013. We have a java based application using Sharepoint 2007 SOAP based webservices.

In Sharepoint 2013 we are using the REST API. And I am not seeing an obvious way to make a single call to get a list of documents for Shared Documents and have it include the Author's name.

I am calling to this REST endpoint:

https://www.acme.org/sites/PortalTest/_api/Web/GetFolderByServerRelativeUrl('/sites/PortalTest/Shared%20Documents')/Files?$select=*

I do get an Author property back, but it points to another REST end point (partial JSON response):

            "Author":{
           "__deferred":{
              "uri":"https://www.acme.org/sites/PortalTest/_api/Web/GetFileByServerRelativeUrl('/sites/PortalTest/Shared%20Documents/Test.docx')/Author"
           }

Now I could make separate calls to get the Author information, but I'd rather not do it that way.

Is there anyway to make one call to get the documents in a Shared Documents folder that will include the author's name using the Sharepoint 2013 REST API?

EDIT TO ADD:

I found the answer. Adding the "expand" parameter will flush out deferred properties:

https://www.acme.org/sites/PortalTest/_api/Web/GetFolderByServerRelativeUrl('/sites/PortalTest/Shared%20Documents')/Files?$expand=Author

1

Try this query

?$select=Author/Id,Author/Name,Author/Title,Editor/Id,Editor/Name,Editor/Title,*&$expand=Author,Editor

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.