pages/{pageid}/tags (GET)
Overview
Retrieve the tags on 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 |
authenticate | bool? | Force authentication for request (default: false) |
redirects | int? | If zero, do not follow page redirects. |
export | bool? | Strip tag xml of site specific information (default: false |
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 | The requested page could not be found |
Message Format
Output:
<tags count="{int}" href="{uri}"> <tag value="{text}"> <type>{text|date|define}</type> <uri>{text}</uri> <title>{text}</title> <related count="{int}"> <page id="{int}" href="{uri}"> <title>{text}</title> <path>{text}</path> </page> </related> </tag> ... </tags>
C# Code Sample: Retrieve Page Tags
The following code example retrieves the tags on 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", "tags").Get();
Sample Response from executing Code
<tags count="3" href="http://deki-hayes/@api/deki/pages/31/tags"> <tag value="text tag"> <type>text</type> <uri>http://deki-hayes/Special:Tags?tag=text+tag</uri> <title>text tag</title> </tag> <tag value="date:2007-08-29"> <type>date</type> <uri>http://deki-hayes/Special:Events?from=2007-08-29</uri> <title>Wednesday, August 29, 2007</title> </tag> <tag value="define:this tag is a define"> <type>define</type> <uri>http://deki-hayes/Page_Title</uri> <title>this tag is a define</title> <related count="1"> <page id="29" href="http://deki-hayes/@api/deki/pages/29"> <title>DekiWiki (Hayes)</title> <path /> </page> </related> </tag> </tags>
Curl Code Sample: Retrieve Page Tags
The following command retrieves a list of tags attached to page "foo":
Sample Code
curl -u username:password -i http://mindtouch.address/@api/deki/pages/=foo/tags
Sample Response from executing Code
Sample response of running the command on a page with two tags:
Content-Type: application/xml
<tags count="2" href="http://192.168.59.128/@api/deki/pages/565/tags"> <tag value="awesome" id="10" href="http://192.168.59.128/@api/deki/site/tags/10"> <type>text</type> <uri>http://192.168.59.128/Special:Tags?tag=awesome</uri> <title>awesome</title> </tag> <tag value="real cool" id="11" href="http://192.168.59.128/@api/deki/site/tags/11"> <type>text</type> <uri>http://192.168.59.128/Special:Tags?tag=real+cool</uri> <title>real cool</title> </tag> </tags>
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.