Sunday, February 9, 2014

A little REST

This REST query shows how to retrieve user information from a given version of a file:
https://dissingconsulting.sharepoint.com/_api/Web/GetFileByServerRelativeUrl('/Shared%20Documents/test.docx')/Versions(1)/?$expand=CreatedBy
The query will include both the version information and the user information.

First: Query the file
https://dissingconsulting.sharepoint.com/_api/Web/GetFileByServerRelativeUrl('/Shared%20Documents/test.docx')

Second: Query the first version of the file
/Versions(1)

Third: Use the expand function to retrieve the user information. Remember to add the $ in to the query string, to tell the rest service, the “expand” argument is a function
?$expand=CreatedBy

No comments:

Post a Comment