Overview
public. Revert page to an earlier revision
Uri Parameters
| Name | Type | Description |
| pageid | string | either an integer page ID, "home", or "=" followed by a double uri-encoded page title |
Query Parameters
| Name | Type | Description |
| fromrevision | int | Revision number of page that will become the new head revision |
| redirects | int? | If zero, do not follow page redirects. |
Return Codes
| Name | Value | Description |
| BadRequest | 400 | Invalid input parameter or request body |
| Forbidden | 403 | Update access to the page is required |
| NotFound | 404 | Requested page could not be found |
| Ok | 200 | The request completed successfully |
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();;