Skip to main content
NICE CXone Expert
Expert Success Center

pages/{pageid}/contents (GET)

Overview

Retrieve the contents of a page.

  • REST Method: GET
  • Method Access: public

Uri Parameters

Name Type Description
pageid string either an integer page ID, "home", or "=" followed by a double uri-encoded page path

Query Parameters

Name Type Description
overview bool? Include the overview section. (default: false)
include bool? Treat page as an include (default: false)
reltopath string? Page used for path normalization. Ignored if relto parameter is defined. (default: none)
relto int? Page used for path normalization (default: none)
authenticate bool? Force authentication for request (default: false)
pageid int? For template pages, use specified page ID as context for template invocation (default: none)
includes string? Comma separated list of extra elements to include (choice of "overview", "tags". default: include nothing extra)
format {html, xhtml, text, dekicode}? Result format. Text only valid in mode=view if the page was authored by someone with unsafecontent permission (default: html)
highlight string? Comma separated list of terms to highlight (default: empty)
revision string? Page revision to retrieve. 'head' by default will retrieve latest revision. Positive integer or a TimeUUID will retrieve specific revision
mode {edit, raw, view} render content for different uses; default is 'view'
redirects int? If zero, do not follow page redirects.
section int? The section number (default: none)

Return Codes

Name Value Description
OK 200 The request completed successfully
Non-Authoritative Information 203 Page contents could not be parsed in its native format and was returned in an alternative format instead
Bad Request 400 Invalid input parameter or request body
Forbidden 403 Update access to the page is required
Not Found 404 Requested page could not be found

Message Format

Output:

<content type="{contenttype}">    
  <head>{text}</text>   
  <body>{text}</body>   
  <body target="{target}">{text}</body>  
  ...
  <tail>{text}</tail>   
</content> 

Implementation Notes

Additional information on available render modes: 

  • Edit:  Retrieves the contents used to render the page within the editor.  Links and images are displayed in an editor-consumable format, functions are not evaluated, and no table of contents is generated.   Editorial comments, indicated by <span class="comment">,  are displayed.
  • Raw: Retrieves the contents stored in the database.  No processing is performed.
  • View: Retrieves the contents used to render the page for viewing.  Functions are evaluated and a table of contents is generated.  Free links are automatically resolved into hyperlinks.
  • ViewNoExecute:  Retrieves the contents used to perform a diff.  This mode is identical to View, except that functions are not evaluated.

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.

C# Code Sample: Retrieve Page Contents

The following code example retrieves the view mode contents of the page called "Page_Title":

Sample Code

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 from executing Code

<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>

Implementation notes 

Add notes about requirements or config values

Curl Code Sample: Retrieve Page Contents

The following command retrieves the contents of page "foo":

Sample Code

curl -u username:password -i http://mindtouch.address/@api/deki/pages/=foo/contents

Sample Response from executing Code

Taken from a page with title "Gotham". The HTML data is sandwiched within the <content> element.

Content-Type: application/xml

<content type="text/html" title="Gotham">
  <body>
<p>Home of the Batman</p>
</body>
  <body target="toc"><em>No headers</em></body>
</content>

Implementation notes 

curl flags

-u
Provides external user authentication. Note that if anonymous access is available and authentication is not forced, this flag may be omitted.
-i
Outputs the HTTP response headers. Useful for debugging.

Pages

To view a list of all pages, follow the instructions here.

 

  • Was this article helpful?