Forum Discussion
Forgot I had posted this question. I ended up creating an endpoint to handle subscriptions for both boards and individual threads. The endpoint takes in the following parameters:
- id
- action (add/remove)
- type (threads/board)
Then it goes something like this:
<#if actionParam == "add"> <#assign response = rest("/${typeParam!?url('UTF-8')}/id/${idParam!?url('UTF-8')}/subscriptions/users/self/add?subscription.type=email") /> <#elseif actionParam == "remove"> <#assign response = rest("/${typeParam!?url('UTF-8')}/id/${idParam!?url('UTF-8')}/subscriptions/users/self/type/email/remove") /> <#else> <#-- handle error -->
My original issue had to do with permissions. In general we've found it is best to do any type of "POST" in an endpoint using ajax.
Hey ttadej That's useful.
Is this for subscribing to a label? For example, I create a post and give it a label "Customer Research" and I want to subscribe to this label. Is that something I can do?
- ttadej8 years agoAdvisor
Hi gstelang, I've never used labels and do not see it in their docs. Given that label subscriptions are board-level, my assumption was one could do something like this:
https://$hostname.com/restapi/vc/boards/id/[board_id]/posts/for/labels/text/[label_text]/subscriptions/users/self/add
But that didn't work :(
- gstelang8 years agoMentor
Right - I tried that! Thanks for the help.
Related Content
- 4 years ago