GET:pages/{pageid}/diff

Overview

public. Show changes between revisions

Uri Parameters
NameTypeDescription
pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
Query Parameters
NameTypeDescription
previousstring?Previous page revision to retrieve. 'head' by default will retrieve latest revision. Positive integer will retrieve specific revision
redirectsint?If zero, do not follow page redirects.
revisionstring?Page revision to retrieve. 'head' by default will retrieve latest revision. Positive integer will retrieve specific revision
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:

<content type="{contenttype}">{text}</content>

Implementation Notes

Setting Previous/Revision=1 refers to the earliest revision, 2 refers to the next earliest revision, and so on.  Similarly, Previous/Revision=-1 refers to the revision prior to the current, -2 refers to the revision two prior to the current, and so on. 

This feature uses the ViewNoExecute mode output from GET:pages/{pageid}/contents to perform the diff comparison.

Code Samples

The following code example performs a diff between the current and previous 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", "diff").With("revision", "head").With("previous", -1).Get();

Sample response indicating that the word "original" was deleted and the word "new" was added:

<content type="application/x.deki0702+xml">
    <p>
        <ins>new</ins>
        <del>original</del>
        &nbsp;text
    </p>
</content>
Tag page
You must login to post a comment.