Overview
Builds a site map starting from 'home' page.
- REST Method: GET
- Method Access: public
Query Parameters
Name |
Type |
Description |
startpage |
bool? |
For HTML sitemap, indicates if the start page should be included (default: true) |
format |
{xml, html, google}? |
Result format (default: xml) |
authenticate |
bool? |
Force authentication for request (default: false) |
Return Codes
Name |
Value |
Description |
OK |
200 |
The request completed successfully |
Bad Request |
400 |
Invalid input parameter or request body |
Forbidden |
403 |
Browse access to the page is required |
Not Found |
404 |
Requested page could not be found |
Message Format
Output (XML):
02 | < page id = "{int}" href = "{uri}" > |
Output (HTML):
3 | < a rel = "internal" href = "{uri}" title = "{text}" pageid = "{int}" class = "{text}" >{text}</ a > |
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.
C# Code Sample: Retrieve Sitemap
The following code example retrieves the sitemap in XML format:
Sample Code
2 | p.At( "users" , "authenticate" ).WithCredentials( "admin" , "password" ).Get(); |
3 | p.At( "pages" ).With( "format" , "xml" ).Get(); |
Sample response indicating that the home page has one sub-page called "Page Title". This sub-page has one sub-page called "Subpage 1":
Sample Response from executing Code
03 | < title >DekiWiki (Hayes)</ title > |
07 | < title >Page Title</ title > |
08 | < path >Page_Title</ path > |
11 | < title >Subpage 1</ title > |
12 | < path >Page_Title/Subpage_1</ path > |
Implementation notes
Add notes about requirements or config values
Curl Code Sample: Retrieve Sitemap
The following command retrieves a hierarchical representation of the site's pages:
Sample Response from executing Code
04 | < title >Best Wiki Ever</ title > |
06 | < namespace >main</ namespace > |
12 | < namespace >main</ namespace > |
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.