public. Retrieve the contents of a page.
| Name | Type | Description |
| pageid | string | either an integer page ID, "home", or "=" followed by a double uri-encoded page title |
| Name | Type | Description |
| format | {html, xhtml}? | Result format (default: html) |
| highlight | string? | Comma separated list of terms to highlight (default: empty) |
| mode | {edit, raw, view, viewnoexecute} | render content for different uses; default is 'view' |
| redirects | int? | If zero, do not follow page redirects. |
| revision | string? | Page revision to retrieve. 'head' by default will retrieve latest revision. positive integer will retrieve specific revision |
| section | int? | the section number |
| Name | Value | Description |
| BadRequest | 400 | Invalid input parameter or request body |
| Forbidden | 403 | Update access to the page is required |
| NonAuthoritativeInformation | 203 | Page contents could not be parsed in its native format and was returned in an alternative format instead |
| NotFound | 404 | Requested page could not be found |
| Ok | 200 | The request completed successfully |
Output:
<content type="{contenttype}">
<head>{text}</text>
<body>{text}</body>
<body target="{target}">{text}</body>
...
<tail>{text}</tail>
</content>Additional information on available render modes:
Setting Revision=1 retrieves the earliest revision, 2 retrieves the next earliest revision, and so on. Similarly, Revision=-1 retrieves the revision prior to the current, -2 retrieves the revision two prior to the current, and so on.
The head section contains any JavaScript that needs to be executed before the page is loaded, the body section contains the HTML body of the page, and the tail section contains any JavaScript that needs to be executed after the page is loaded.
Use POST:pages/{pageid}/contents to set the page contents.
The following code example retrieves the view mode contents 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", "contents").With("mode", "view").Get();
Sample response:
<content type="application/x.deki0702+xml">
<body>
<a name="Section1"></a>
<h2>Section1</h2>
<p>section1 text</p>
</body>
<body target="toc">
<ol style="list-style-type:none; margin-left:0px; padding-left:0px;">
<li>1.
<a href="http://deki-hayes/Page_Title#Section1" rel="internal">Section1</a>
</li>
</ol>
</body>
</content>