Gursimrat
11 years agoLeader
Bookmark, float a thread using REST API
I am trying to make POST request to bookmark/ float a thread using following code, but when I check the thread, nothing happens. Below is the code, the requirements is that I want to make a custom button on the category page corresponding to each thread to let user bookmark, subscribe to email. Let me know if there is a workaround for this.
<@liaAddScript> (function( $ ) { $(document).ready(function(){ $.post("http://community.demo.com/restapi/vc/threads/id/89/subscriptions/users/self/add", { subscription_type:"bookmark" }, function(data){ console.log("Success"); }); }); })(LITHIUM.jQuery); </@liaAddScript>
Hi There,
It looks like that for the subscribe call you need to pass in a query parameter subscription.type (and not subscription_type). Look at this
Hope this helps.
Regards,
ChhamaHi ChhamaJ - Thanks, it was indeed one issue but I had to quote 'subscription.type' as well, without those, it was giving an error of unexpected token.
$.post("/restapi/vc/threads/id/"+bk_id+"/subscriptions/users/self/add", { 'subscription.type':"bookmark" },