2 Replies Latest reply: Aug 2, 2013 12:35 PM by JRSim_UIX RSS

    How to use WebCenter REST API to like or comment a activity

      Hi all

      I want to know how to realize like or comment function with REST APIs.

      I execute a REST call with following url, but the 'like' counter is not be increased.

      Is there anything i missed?

      Can anyone give me an example about how to use this API to like or comment a activity?


        • 1. Re: How to use WebCenter REST API to like or comment a activity

          I'm not sure if this is a bug; I'm trying on my local VM and only seem to be able to get the resource type to show/work with documents.


          This shows the capabilities you can then use to pass the correct object to the above.

          I think there was an update to the REST API the comments, likes were moved in PS4 which doesn't seem to have been moved across successfully for other activities...

          Qian your Oracle right can you just push this through to support and let me know if it is a bug with only documents being able to access resource types above..



          So for others reading this -


          Retrieve Comments



          Retrieve Likes






          If you want to retrieve all summary likes info in the initial request make sure you add data=data,commentsSummary,likesSummary to the urn:oracle:webcenter:activities:stream template


          This should retrieve all the info you are looking for



          Qian - I'm not sure the objects/ params:values to pass for commenting and making likes.


          I'm guessing {data:'this is a comment'}

          unfortunately documentation seems to be missing for comments, likes..


          I'll need to dig into the code and see if I can find out what its expecting.

          • 2. Re: How to use WebCenter REST API to like or comment a activity

            So Qian;

            looking through the code this is how you can

            Post a comment (POST)



            {text:'this is my comment)

            Edit a comment (PUT)

            So I haven't tried it but it should do the trick.. although I don't see update under capabilities so you may get blocked.



                id: {commentId},

                text: 'changed my comment.. magic'


            Delete a comment (DELETE)


            Like POST


            I passed it an empty object {} seemed to work for me.


            Unlike (DELETE)



            Let me know if this works for you