Community articleAdding tags to a wiki page
Added by IBM contributorRajmeet S Bal | Edited by IBM contributorPaul Bastide on August 13, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Adding tags programatically

 

Input
Method URI Description
POST /wikis/{auth-type}/api/wiki/{wiki-id}/page/{page-id}/entry Use POST method with header X-Method-Override=PUT to add tags to wiki page
Name Type Optional Description
auth-type
string No auth-type is basic or oauth
wiki-id
string No wiki's id or label
page-id
string No wiki page's id or label
tag
string No tag to be added
Name Type Optional Description
tag
string No value of tag that needs to be added to wiki page. you can use one or more tag parameters
Name Type Optional Description
X-Method-Override
string No Value of X-Method-Override should be PUT
Content-Type
string No
Output
Content Type: application/atom+xml
Code Description
200
OK. Indicates that the request was received successfully.
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.
404
The URL could not be found.
Examples
curl -u "<USERID?EMAIL>:<PASSWORD>" -X POST -H "X-Method-Override: PUT" -H "X-Update-Nonce: <NONCE>" -H "Content-Type: application/atom+xml; charset=utf-8" --data "<entry xmlns=\"http://www.w3.org/2005/Atom\"><category term=\"document\" label=\"document\" scheme=\"tag:ibm.com,2006:td/type\"></category><id>urn:lsid:ibm.com:td:<PAGEID></id></entry>" "https://<SERVER>/wikis/basic/api/wiki/<WIKI_ID_OR_LABEL>/page/<PAGE_ID_OR_LABEL>/entry?tag=<TAG>"
<entry xmlns="http://www.w3.org/2005/Atom">
<category term="document" label="document" scheme="tag:ibm.com,2006:td/type"></category>
<id>urn:lsid:ibm.com:td:c7bc7e9d-5658-44a0-8013-4e12d742b121</id>
</entry>

Response returned by the server
<?xml version="1.0" encoding="UTF-8"?><entry xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:td="urn:ibm.com/td" xmlns="http://www.w3.org/2005/Atom"><id>urn:lsid:ibm.com:td:c7bc7e9d-5658-44a0-8013-4e12d742b121</id><td:uuid>c7bc7e9d-5658-44a0-8013-4e12d742b121</td:uuid><td:label>Welcome to Test</td:label><link href="https://<SERVER>/wikis/basic/api/wiki/Wc0d10195a46c_4187_8efd_90fa39de2ff3/page/Welcome%20to%20Test/entry" rel="self"></link><link href="https://<SERVER>/wikis/home/wiki/Wc0d10195a46c_4187_8efd_90fa39de2ff3/page/Welcome%20to%20Test" rel="alternate" type="text/html"></link><link href="https://<SERVER>/wikis/basic/api/wiki/Wc0d10195a46c_4187_8efd_90fa39de2ff3/page/Welcome%20to%20Test/entry" rel="edit"></link><link href="https://<SERVER>/wikis/basic/api/wiki/ac1c6882-860a-4c09-b77d-7414562bc3fe/page/c7bc7e9d-5658-44a0-8013-4e12d742b121/media" rel="edit-media"></link><link href="https://<SERVER>/wikis/basic/api/wiki/ac1c6882-860a-4c09-b77d-7414562bc3fe/page/c7bc7e9d-5658-44a0-8013-4e12d742b121/media/Welcome%20to%20Test?convertTo=html&amp;errorPage=true&amp;f=Welcome%20to%20Test" rel="enclosure" type="application/x-www-form-urlencoded" title="Welcome to Test" hreflang="en" length="0"></link><link href="https://<SERVER>/wikis/basic/api/wiki/ac1c6882-860a-4c09-b77d-7414562bc3fe/page/c7bc7e9d-5658-44a0-8013-4e12d742b121/entry" rel="related"></link><category term="page" scheme="tag:ibm.com,2006:td/type" label="page"></category><category term="test" label="test"></category><category term="testtag" label="testtag"></category><link href="https://<SERVER>/wikis/basic/api/wiki/ac1c6882-860a-4c09-b77d-7414562bc3fe/page/c7bc7e9d-5658-44a0-8013-4e12d742b121/feed" rel="replies" type="application/atom+xml" thr:count="0" xmlns:thr="http://purl.org/syndication/thread/1.0"></link><snx:orgId>20000393</snx:orgId><snx:orgName>IBM Connections Developers</snx:orgName><td:policy><td:organizationPublic>true</td:organizationPublic><td:contentFollowing>true</td:contentFollowing></td:policy><author><name>John Doe0</name><snx:userid>20000395</snx:userid><snx:orgId>20000393</snx:orgId><snx:orgName>IBM Connections Developers</snx:orgName><email></email><snx:userState>active</snx:userState></author><title type="text">Welcome to Test</title><published>2015-05-04T14:44:48.667Z</published><updated>2015-08-12T11:37:33.729Z</updated><td:library><td:libraryTitle>Test</td:libraryTitle><td:libraryUuid>ac1c6882-860a-4c09-b77d-7414562bc3fe</td:libraryUuid></td:library><td:created>2015-05-04T14:44:48.667Z</td:created><td:modified>2015-08-12T11:37:32.665Z</td:modified><td:modifier><name>John Doe0</name><snx:userid>20000395</snx:userid><snx:orgId>20000393</snx:orgId><snx:orgName>IBM Connections Developers</snx:orgName><email></email><snx:userState>active</snx:userState></td:modifier><td:visibility>public</td:visibility><td:versionUuid>8c30f2a8-1cc6-4308-b0e6-9df99658f28b</td:versionUuid><td:versionLabel>2</td:versionLabel><td:propagation>false</td:propagation><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/recommendations">0</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/comment">0</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/share">0</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/collections">0</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/attachments">0</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/versions">2</snx:rank><td:totalMediaSize>462</td:totalMediaSize><summary type="text"></summary><content type="text/html" src="https://<SERVER>/wikis/basic/api/wiki/ac1c6882-860a-4c09-b77d-7414562bc3fe/page/c7bc7e9d-5658-44a0-8013-4e12d742b121/media?convertTo=html"></content><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/hit">1</snx:rank><snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/anonymous_hit">1</snx:rank></entry>