MindTouch Developer Center > MindTouch Deki > API Reference > POST:pages/{pageid}/revert

Overview

public. Revert page to an earlier revision

Uri Parameters
NameTypeDescription
pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
Query Parameters
NameTypeDescription
fromrevisionintRevision number of page that will become the new head revision
redirectsint?If zero, do not follow page redirects.
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Forbidden403Update access to the page is required
NotFound404Requested page could not be found
Ok200The request completed successfully

Message Format

None

Implementation Notes

Setting Fromrevision=1 reverts to the earliest revision, 2 reverts to the next earliest revision, and so on.  Similarly, Fromrevision=-1 reverts to the revision prior to the current, -2 reverts to the revision two prior to the current, and so on. 

Use GET:pages/{pageid}/revisions to retrieve page revision information.

Code Samples

The following code example reverts the home page to its original contents:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("pages", "home", "revert").With("fromrevision", 1).Post();;
Tag page
You must login to post a comment.