Forum Discussion

gstelang's avatar
gstelang
Mentor
8 years ago

How do I subscribe and unsubscribe to a label using API?

Hi Folks, 

 

I am creating a new page called "My Interests" page which has a list of all the labels I am subscribed to. I also want to allow users to subscribe to the label from that page. Is there a REST API I can use to achieve this? 

 

I could not find anything specific under https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1 

 

Thanks

7 Replies

  • Hi gstelang:

     

    Kindly check this Discussion. Hope it will work.

     

    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

    Thanks & Regards,
    Abhishek Illindra

  • gstelang's avatar
    gstelang
    Mentor
    8 years ago

    Hi AbhishekIlindra - This is not the same API.

     

    That link mentioned in the discussion : https://<our community>.stage.lithium.com/community/s/restapi/vc/boards/id/<boardid>/labels/predefined

     

    shows a list of labels for the board but I want to *subscribe* to a label.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    gstelang  
    I tried to find all the related stuff to labels but it seems lithium does not provide any such API. 

  • gstelang's avatar
    gstelang
    Mentor
    8 years ago

    I have been doing some digging. Looks like there could be few ways:

     

    1> This is how Lithium seems to do it by associating every link with ticket id and the following URL call will subscribe me to "Bulk Data" label.

    https://community.lithium.com/t5/tkb/v2/page.filteredbylabelname.subscribetolabelname.link:subscribeaction/label-name/Bulk%20Data/board-id/studio%40tkb/subscribed/false?t:ac=blog-id/studio%40tkb/label-name/bulk%20data&ticket=<ticketid> 
     

     

     

    However, our community uses "lia-action-token" and form HTTP post request with token to achieve. How can we update to ticket based HTTP post requests? If so, how can I obtain a ticket?

     

    2> VikasB This person's question makes me believe it's possible but there are no responses to him https://community.lithium.com/t5/Developer-Discussion/Subscription-REST-call-fails-as-admin/m-p/270530

    (I get the same behavior when I tried myself)

     

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Hi gstelang  

    ttadej was working on board/blog/QandA subscription. That can be done as API exists for board/blog/QandA subscription.  

    But it throwing off when it comes to label subscription as no API seems to exist. I do not think it is feasible using API.

    Here are some similar discussions

    https://community.lithium.com/t5/Developer-Discussion/Using-API-LiQL-to-query-Subscriptions/m-p/184611#M7508

    https://community.lithium.com/t5/Developer-Discussion/Rest-API-call-to-subscribe-users-to-labels/m-p/302320#M11591

  • gstelang's avatar
    gstelang
    Mentor
    8 years ago

    :(

     

    Thanks, VikasB for the Help! I will reach out to Lithium engineer if anything custom can be built for us.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    gstelang  

    Yes, you can reach out to support team or you can post your ideas here also.  You know initially, there was not the manual subscription to a label also but someone posted an idea here and Lithium implemented it.