MindTouch Developer Center > MindTouch Deki > API Reference > GET:pages/{pageid}/revisions

GET:pages/{pageid}/revisions

Overview

public. Retrieve revision history of a given title

Uri Parameters
NameTypeDescription
pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
Query Parameters
NameTypeDescription
maxint?Max number of revisions to includes (default: 50)
offsetint?Skipped revisions (default: 0)
redirectsint?If zero, do not follow page redirects.
revisionint?Page revision to retrieve
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Forbidden403Read access to the page is required
NotFound404Requested page could not be found
Ok200The request completed successfully

Message Format

Output:

<pages>
    <page id="{int}" revision="{int}" href="{uri}">
        <title>{text}</title> 
        <path>{text}</path> 
        <date.edited>{date}</date.edited> 
        <user.author id="{int}" href="{uri}">
            <nick>{text}</nick> 
            <username>{text}</username> 
            <email>{text}</email> 
        </user.author>
        <description>{text}</description> 
        <contents type="{contenttype}" href="{uri}" /> 
    </page>
    ...
</pages>

Implementation Notes

A new page revision is created whenever the page is modified.

Use GET:pages/{pageid}/contents with the revision parameter to retrieve the contents of a page from a specified revision.  It is also possible to compare the contents of two revisions with GET:pages/{pageid}/diff.

Code Samples

The following code example retrieves the revisions of the page called "Page Title":

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("pages", "=Page_Title", "revisions").Get();

Sample response indicating that there is one revision:

<pages>
    <page id="31" revision="1" href="http://deki-hayes/@api/deki/pages/31/revisions?revision=1&redirects=0">
        <title>Page Title</title> 
        <path>Page_Title</path> 
        <date.edited>2007-08-29T23:03:18Z</date.edited> 
        <user.author id="1" href="http://deki-hayes/@api/deki/users/1">
            <nick>Admin</nick> 
            <username>Admin</username> 
            <email>admin@mindtouch.com</email> 
        </user.author>
        <description>2 words added</description> 
        <contents type="application/x.deki0702+xml" href="http://deki-hayes/@api/deki/pages/31/revisions/contents?revision=1&redirects=0" /> 
    </page>
</pages>
Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08