Redirected from MindTouch Deki/API Reference/GET:pages/{pageid}/contents
Was this page helpful?

GET:pages/{pageid}/contents

    Overview

    public. Retrieve the contents of a page.

    Uri Parameters
    NameTypeDescription
    pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
    Query Parameters
    NameTypeDescription
    authenticatebool?Force authentication for request (default: false)
    format{html, xhtml}?Result format (default: html)
    highlightstring?Comma separated list of terms to highlight (default: empty)
    includebool?Treat page as an include (default: false)
    mode{edit, raw, view}render content for different uses; default is 'view'
    pageidint?For template pages, use specified page ID as context for template invocation (default: none)
    redirectsint?If zero, do not follow page redirects.
    reltoint?Page used for path normalization (default: none)
    reltopathstring?Page used for path normalization. Ignored if relto parameter is defined. (default: none)
    revisionstring?Page revision to retrieve. 'head' by default will retrieve latest revision. positive integer will retrieve specific revision
    sectionint?The section number (default: none)
    Return Codes
    NameValueDescription
    BadRequest400Invalid input parameter or request body
    Forbidden403Update access to the page is required
    NonAuthoritativeInformation203Page contents could not be parsed in its native format and was returned in an alternative format instead
    NotFound404Requested page could not be found
    Ok200The request completed successfully

    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.

    Code Samples

    C# Samples

     

    Curl Samples

     

    PHP Samples

     

    Other Code Samples

     

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by