pages/{pageid}/subpages (GET)
Overview
Retrieve list of sub-pages
- 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 |
authenticate | bool? | Force authentication for request (default: false) |
redirects | int? | If zero, do not follow page redirects. |
offset | int? | Number of items to skip. Must be a positive number or 0 to not skip any. (default: 0) |
limit | string? | Maximum number of items to retrieve. Must be a positive number or 'all' to retrieve all items. (default: 100) |
Return Codes
Name | Value | Description |
OK | 200 | The request completed successfully |
Bad Request | 400 | Invalid input parameter or request body |
Forbidden | 403 | Read access to the page is required |
Not Found | 404 | Requested page could not be found |
Message Format
Output:
<subpages href="{uri}"> <page.subpage id="{int}" href="{uri}"> <title>{text}</title> <path>{text}</path> </page.subpage> ... </subpages>
Implementation Notes
Redirect and archived pages are not included in the output.
C# Code Sample: Retrieve Page Subpages
The following code example retrieves the sub-pages for the home page:
Sample Code
Plug p = Plug.New("http://deki-hayes/@api/deki"); p.At("users", "authenticate").WithCredentials("admin", "password").Get(); p.At("pages", "home", "subpages").Get();
Sample Response from executing Code
Sample response indicating that there is one sub-page:
<subpages href="http://deki-hayes/@api/deki/pages/29/subpages"> <page.subpage id="31" href="http://deki-hayes/@api/deki/pages/31"> <title>Page Title</title> <path>Page_Title</path> </page.subpage> </subpages>
Curl Code Sample: Retrieve Page Subpages
The following command retrieves a list of page "foo"'s sub-pages.
Sample Code
curl -u username:password -i http://mindtouch.address/@api/deki/pages/=foo/subpages
Sample Response from executing Code
Example response from a page with 2 sub-pages. Note that only sub-pages within one level are returned.
<subpages totalcount="2" count="2" href="http://192.168.59.128/@api/deki/pages/565/subpages"> <page.subpage id="600" href="http://192.168.59.128/@api/deki/pages/600?redirects=0" terminal="false" subpages="true"> <uri.ui>http://192.168.59.128/Bar/Foo</uri.ui> <title>Foo</title> <path>Bar/Foo</path> <namespace>main</namespace> </page.subpage> <page.subpage id="602" href="http://192.168.59.128/@api/deki/pages/602?redirects=0" terminal="true" subpages="false"> <uri.ui>http://192.168.59.128/Bar/Mars</uri.ui> <title>Mars</title> <path>Bar/Mars</path> <namespace>main</namespace> </page.subpage> </subpages>
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.