GET:pages

Overview

public. Builds a site map starting from 'home' page.

Uri Parameters

None

Query Parameters
NameTypeDescription
format{xml, html, google}?Result format (default: xml)
startpagebool?For HTML sitemap, indicates if the start page should be included (default: true)
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Forbidden403Browse access to the page is required
NotFound404Requested page could not be found
Ok200The request completed successfully

Message Format

Output (XML):

<pages>
    <page id="{int}" href="{uri}">
        <title>{text}</title> 
        <path>{text}</path> 
        <subpages>
            <page>...</page>
            ...
        </subpages>
    </page>
</pages>

Output (HTML):

<ul>
    <li>
        <a rel="internal" href="{uri}" title="{text}" pageid="{int}" class="{text}">{text}</a>
        <ul>
            <li>...</li>
            ...
        </ul>
    </li>
</ul>

Output (sitemap): Refer to http://www.google.com/schemas/sitemap/0.84

Implementation Notes

Redirect and archived pages are not included in the sitemap.

Use GET:pages/{pageid}/tree to retrieve the sitemap from a specified page.

Code Samples

The following code example retrieves the sitemap in XML format:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("pages").With("format", "xml").Get();

Sample response indicating that the home page has one subpage called "Page Title".  This subpage has one subpage called "Subpage 1":

<pages>
    <page id="29" href="http://deki-hayes/@api/deki/pages/29">
        <title>DekiWiki (Hayes)</title> 
        <path /> 
        <subpages>
            <page id="31" href="http://deki-hayes/@api/deki/pages/31">
                <title>Page Title</title> 
                <path>Page_Title</path> 
                <subpages>
                    <page id="32" href="http://deki-hayes/@api/deki/pages/32">
                        <title>Subpage 1</title> 
                        <path>Page_Title/Subpage_1</path> 
                        <subpages /> 
                    </page>
                </subpages>
            </page>
        </subpages>
    </page>
</pages>
Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08