Skip to end of metadata
Go to start of metadata

About

IBM Connections 4 expose a way to get the comments of a wiki page. Here's one easy way to do it with an asynchronous HTTP (Ajax) request using jQuery.

There is not a link to IBM Connections 4 documentation.

Atom API Request Details

Headers

Content-Type : application/atom+xml;type=entry;charset=UTF-8

Type

GET

URL

{host}/wikis/basic/api/wiki/{container-id}/page/{element-id}/feed

Example

http://www.mysite.com/wikis/basic/api/wiki/ f38e0-45-4cb-8a2e-74a3f97/page/56dc-a2-45-89-894c32/feed

Additional Parameters

Parameter
Description
psPage size. Specifies the number of comments to return.

Response

Status Code: 200 OK
Example using jQuery

$.ajax({
    url : "http://www.mysite.com/wikis/basic/api/wiki/f38e0-45-4cb-8a2e-74a3f97/page/56dc-a2-45-89-894c32/feed?ps=200",
    type : "GET",
    contentType: "application/atom+xml;charset=UTF-8",
    async : true,
	statusCode : {        
		200 : function(xml) {
            console.log('comments');
        }
    },
    error: function(jqXHR, textStatus, errorThrown) {
        console.log(jqXHR + " - " + textStatus + ' - ' + errorThrown);
    }
});

Note:  console.log can throw errors in IE, they are there for illustrative purposes only and should be changed as required.

Example Response

 <?xml version="1.0" encoding="UTF-8"?>
<feed 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">
    <generator version="4.0.0.0" uri="http://www.ibm.com/xmlns/prod/sn">IBM Connections - Wikis</generator>
    <id>urn:lsid:ibm.com:td:48506288-c883-4f11-b951-5d74943b6c7d</id>
    <link href="http://www.mysite.com/wikis/basic/api/wiki/W03969eb_4f_a02_5f0d4/page/page%201%20test/feed" rel="self"></link>
    <title type="text">page 1 test</title>
    <author>
        <name>Joaquin</name>
        <snx:userid>B0952-122-43B-BFE-14B1AB78</snx:userid>
        <email>email@email.com</email>
        <snx:userState>active</snx:userState>
    </author>
    <updated>2013-01-04T22:25:47.684Z</updated>
    <opensearch:totalResults>4</opensearch:totalResults>
    <app:collection href="http://www.mysite.com/wikis/basic/api/wiki/W03963eeb_4f2_a02_5f33d4/page/page%201%20test/feed" xmlns:app="http://www.w3.org/2007/app">
        <title type="text">page 1 test</title>
        <app:accept>application/*</app:accept>
        <app:accept>image/*</app:accept>
        <app:accept>*/*</app:accept>
    </app:collection>
    <entry>
        <id>urn:lsid:ibm.com:td:424ec7-f75c-46-97e-0a9a3af</id>
        <category term="comment" scheme="tag:ibm.com,2006:td/type" label="comment"></category>
        <title type="text">Re: page 1 test</title>
        <author>
            <name>Joaquin</name>
            <snx:userid>B052-C2-1B-BFEE-1C1EAB78</snx:userid>
            <email>email@email.com</email>
            <snx:userState>active</snx:userState>
        </author>
        <published>2013-01-04T22:53:41.723Z</published>
        <updated>2013-01-04T22:53:41.723Z</updated>
        <link href="http://www.mysite.com/wikis/basic/api/wiki/83721-1eb2-4db-8cdc-6758327/page/485288-c883-4f11-b951-543b6c7d/comment/424c7-f75c-4628-972e-0ada359af/entry" rel="self"></link>
        <link href="http://www.mysite.com/wikis/home/wiki/W03969cae3eeb_4ff2_a002_5f053d4/page/page%201%20test/comment/4246c7-f75c-4628-972e-29da359af" rel="alternate" type="text/html"></link>
        <link href="http://www.mysite.com/wikis/basic/api/wiki/83221-1e2-4d1b-dc-6758327/page/485288-c83-4f1-b51-5d7496c7d/comment/42c7-f75c-4628-972e-02359af/entry" rel="edit"></link>
        <link href="http://www.mysite.com/wikis/basic/api/wiki/83721-1e2-4d1b-dc-67544227/page/45088-c83-4f1-b51-5d7b6c7d/comment/4246c7-f75c-4628-972e-29da3af/media" rel="edit-media"></link>
        <td:uuid>424ec7-f5c-468-97e-0ad59af</td:uuid>
        <td:modifier>
            <name>Joaquin</name>
            <snx:userid>B04852-1C2-43B-BFE-1C1478</snx:userid>
            <email>email@email.com</email>
            <snx:userState>active</snx:userState>
        </td:modifier>
        <td:modified>2013-01-04T22:53:41.723Z</td:modified>
        <td:created>2013-01-04T22:53:41.723Z</td:created>
        <td:language>en</td:language>
        <td:versionLabel>2</td:versionLabel>
        <td:deleteWithRecord>false</td:deleteWithRecord>
        <content type="text">comment 4</content>
    </entry>
</feed>

About the author

Enterprise Web Developer
Joaquin is an Enterprise Web Developer at Base22 with over seven years of experience designing and developing web solutions for enterprise clients. He is a well rounded web developer with skills building interfaces in IBM WebSphere Portal and WCM, IBM Connections, and many others. He is an Oracle Certified Java Developer and a Microsoft Certified Visual Studio Developer. He blogs at http://j-arellano.com

  • No labels