Learn By Example: History Queries
This section is a series of examples, starting with simpler queries and moving to more advanced queries. Any of these examples are viewable directly in a web browser capable of displaying XML data.
How to query an asset "as of" a specific time
Use the asof query parameter to retrieve data as it existed at some point in time. This URL finds the version of a Story asset as it existed at 5:30 PM on October 3rd, 2005:
http://localhost/VersionOne/rest-1.v1/Hist/Story/1364?asof=2005-08-03T17:30:00.00&sel=Name,ToDo,ChangeDate
How to query the history of a single asset
This URL will retrieve the history of the Member asset with ID 20.
http://localhost/VersionOne/rest-1.v1/Hist/Member/20
How to query the history of a single attribute
This URL will retrieve the history of changes to the Email attribute of the Member asset with ID 20:
http://localhost/VersionOne/rest-1.v1/Hist/Member/20/Email
How to query the history of many assets
This URL will retrieve history for all Story assets you are able to see:
http://localhost/VersionOne/rest-1.v1/Hist/Story?sel=Name,ToDo,ChangeDate&page=100,0
The page parameter matters more on Hist than anywhere else. A history query returns one row per version of each asset, not one per asset, so an unpaged history query across a whole asset type is typically the largest result set the API can produce. rest-1.v1 applies no default page size, so it attempts to return all of it.
The form is page=<size>,<start>, so the size comes first, not the start. Note also that history requests are sorted by Moment ascending unless you supply your own sort. If you do, the results might no longer be chronological.