Skip to end of metadata
Go to start of metadata

About

IBM Connections 4 expose a way to get the comments of a Status Update 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/json; charset=UTF-8
TypeGET

URL

{host}/connections/opensocial/rest/ublog/@all/@all/urn:lsid:lconn.ibm.com:profiles.note:{post-id}/comments

Example:  

https://www.mysite.com/connections/opensocial/rest/ublog/@all/@all/urn:lsid:lconn.ibm.com:profiles.note:841e-ad-f7a-ae5-8f7d/comments

ResponseStatus Code: 200 OK
Example using jQuery

$.ajax({
    url : "https://www.mysite.com/connections/opensocial/rest/ublog/@all/@all/urn:lsid:lconn.ibm.com:profiles.note:841e-ad-f7a-ae5-8f7d/comments",
    type : "GET",
    contentType: "application/json; 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

{
    "startIndex": 0,
    "totalResults": 3,
    "filtered": true,
    "itemsPerPage": 3,
    "sorted": true,
    "list": [
        {
            "summary": "test comment",
            "objectType": "comment",
            "content": "test comment",
            "author": {
                "connections": {
                    "state": "active"
                },
                "objectType": "person",
                "id": "urn:lsid:lconn.ibm.com:profiles.person:B952-1C2-431B-BEE-1CA4B78",
                "displayName": "Joaquin Alonso Arellano Ramirez"
            },
            "id": "urn:lsid:lconn.ibm.com:profiles.comment:8a16-d1d-444-8d0-5b9d6e4",
            "likes": {
                "totalItems": 0
            },
            "published": "2013-01-23T18:32:45.398Z"
        }
    ],
    "updatedSince": true
}

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