IBM Connections 4 API: How to Like a Status Update Message Using jQuery Ajax
About
If you have not already liked a Status Update Message, you can do so by sending a request to the web address of the status update entry. Here's one easy way to do it with an asynchronous HTTP (Ajax) request using jQuery.
There is no a link to IBM Connections 4 documentation.
Atom API Request Details
Headers |
Content-Type: application/json |
---|---|
Type | POST |
URL | {host}/connections/opensocial/rest/ublog/@all/@all/{post-id}/likes Example: https://www.mysite.com/connections/opensocial/rest/ublog/@all/@all/9b6ff-37f-4fd-a40-de264bc/likes |
Response | Status Code: 200 OK |
Example using jQuery
$.ajax({ url : "https://www.mysite.com/connections/opensocial/rest/ublog/@all/@all/9b6ff-37f-4fd-a40-de264bc/likes", type : "POST", contentType: "application/json", async : true, statusCode : { 200 : function() { console.log('Liked'); } }, 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.