Skip to end of metadata
Go to start of metadata

About

IBM Connections 4 expose a way to get the comments of a Blog entry. 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}/blogs/roller-ui/rendering/feed/{container-id}/entrycomments/{element-name/atom

Example

http://www.mysite.com/blogs/roller-ui/rendering/feed/ f38080-4b5-4ca-8e-741ff97/entrycomments/test_blog_entry_joaquin/atom

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/blogs/roller-ui/rendering/feed/f38080-4b5-4ca-8e-741ff97/entrycomments/test_blog_entry_joaquin/atomatom?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'?>
<?xml-stylesheet type="text/xsl" href="http://www.mysite.com/blogs/roller-ui/styles/atom.xsl" media="screen"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:thr="http://purl.org/syndication/thread/1.0"
xmlns:snx="http://www.ibm.com/xmlns/prod/sn"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
    <id>urn:lsid:ibm.com:blogs:entrycomments-e5f21c9a-eee3-44d5-93f6-3ebc5cc36fad</id>
    <title type="html">test blog entry - joaquin (Comments)</title>
    <subtitle type="html">test blog entry - joaquin (Comments)</subtitle>
    <link rel="alternate" type="text/html" href="http://www.mysite.com/blogs/006179-4811-417-b12-da2910f47d/entry/test_blog_entry_joaquin?lang=en_us" />
    <link rel="self" type="application/atom+xml" href="http://www.mysite.com/blogs/roller-ui/rendering/feed/006079-4811-417-b612-da0f0347d/entrycomments/test_blog_entry_joaquin/atom?lang=en_us&amp;ps=500" />
    <link rel="first" type="application/atom+xml" href="http://www.mysite.com/blogs/006079-4811-4417-b612-da290347d/feed/entrycomments/test_blog_entry_joaquin/atom?ps=100&amp;lang=en_us" />
    <opensearch:totalResults>4</opensearch:totalResults>
    <updated>2013-01-08T11:02:55-06:00</updated>
    <generator uri="http://www.ibm.com/xmlns/prod/sn" version="4.0.0.0">IBM Connections - Blogs</generator>
    <entry xml:base="http://www.mysite.com/blogs/00679-4811-4417-b612-da2047d/entry/test_blog_entry_joaquin">
        <id>urn:lsid:ibm.com:blogs:comment-a4056a-809c-47b-b4f-9df87c4c4</id>
        <title type="text">Re: test blog entry - joaquin</title>
        <author>
            <name>Joaquin</name>
            <email>email@email</email>
            <snx:userid>B0452-1C2-43B-BE-14BB78</snx:userid>
            <snx:userState>active</snx:userState>
        </author>
        <snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">00079-4811-17-b12-da2910347d</snx:communityUuid>
        <link rel="http://www.ibm.com/xmlns/prod/sn/container" type="application/atom+xml" href="http://www.mysite.com/communities/service/atom/community/instance?communityUuid=00079-411-417-b62-daf347d" />
        <link rel="self" type="application/atom+xml" href="http://www.mysite.com/blogs/0066079-411-4417-b62-da2f0347d/feed/comment/atom?commentid=a4856a-809c-4eb-b4f-913f87c4c4&amp;lang=en_us"/>
        <link rel="alternate" type="text/html" href="http://www.mysite.com/blogs/016079-411-447-b12-da2910347d/entry/test_blog_entry_joaquin?lang=en_us#comment-13576645748"/>
        <link rel="http://www.ibm.com/xmlns/prod/sn/recommendations" href="http://www.mysite.com/blogs/006179-481-417-b12-da2910f03d/feed/commentrecommendations/a4846a-89c-47eb-b4f-9d87c4c4/atom?lang=en_us" />
        <app:collection href="http://www.mysite.com/blogs/006079-4811-447-b12-da291347d/api/recommend/comments/a4846a-80c-47eb-b46f-9df87c4?lang=en_us">
            <title type="text">Likes</title>
            <category scheme="http://www.ibm.com/xmlns/prod/sn/collection" term="recommend" />
            <app:categories fixed="yes"/>
        </app:collection>
        <published>2013-01-08T11:02:55-06:00</published>
        <updated>2013-01-08T11:02:55-06:00</updated>
        <content type="html">
            <![CDATA[comment 4]]>
        </content>
        <summary type="text">
            <![CDATA[comment 4]]>
        </summary>
        <snx:trackbacktitle>RE: test blog entry - joaquin</snx:trackbacktitle>
        <thr:in-reply-to ref="urn:lsid:ibm.com:blogs:entry-e5f21c9a-eee3-44d5-93f6-3ebcc36fad"
        source="http://www.mysite.com/blogs/006079-481-447-b612-da2910347d/feed/entries/atom?lang=en_us"
        href="http://www.mysite.com/blogs/001679-411-417-b612-da290347d/entry/test_blog_entry_joaquin?lang=en_us"
        type="text/html" />
        <snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/recommendations">0</snx:rank>
        <source>
            <id>urn:lsid:ibm.com:blogs:entry-e5f29a-ee3-45-9f6-3ebc36fad</id>
            <title type="text">base 22 - joaquin test - Comments</title>
            <link type="application/atom+xml" rel="self" href="http://www.mysite.com/blogs/006079-481-447-b12-da10f0347d/feed/entrycomments/test_blog_entry_joaquin/atom?lang=en_us" />
            <link type="text/html" rel="alternate" href="http://www.mysite.com/blogs/006079-41-447-b62-da910f0347d/entry/test_blog_entry_joaquin?lang=en_us"/>
        </source>
    </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