Forum Discussion

Inactive User's avatar
Inactive User
5 years ago

How to subscribe to a label using a custom link, expecially in a Forum?

Is there a way to subscribe to a label using a custom link? I see that in the Subscribe to Label link in TKBs, there is a url and a token. (See code below)

Is there a way to do this without the token? Or how does one generate a token?

I have a custom listing page I want to use, and want to add a subscribe to label link on it...

 

<a class="lia-link-navigation subscribe-to-label-link lia-link-ticket-post-action" data-lia-action-token="q-rlUVWyJprfXFSJi-OCeZNSAFKk7xQH-6zDhiPg3sI." rel="nofollow" id="link_7" href="https://yoursite.com/t5/tkb/v2/page.filteredbylabelname.subscribetolabelname.link:subscribeaction/label-name/Analytical%20Application%20Development/board-id/add-ins/subscribed/false?t:ac=blog-id/add-ins/label-name/analytical%20application%20development">Subscribe</a>

 

12 Replies

  • Inactive User's avatar
    Inactive User
    5 years ago

    MattV and or Tarun I'm completely at a loss here. Can you show me specifically what to do? 

    I'm happy to either do this in an endpoint or with JQuery, but I'm just not sure how to get the subscription part to work with an API call. 

    I can get the basic call to work in JQuery using Tarun's script but beyond that I'm unable to understand what's required beyond this: 

        <@liaAddScript>
        ;(function ($) {
            $.ajax({
                type: "Get",
                url: "/api/2.0/search?q=SELECT * FROM users WHERE id='${user.id}'",
    
                success: function (data) {
    
                    console.log('SubscribetoLabel', data)
    
                },
            });
        })(LITHIUM.jQuery);
        </@liaAddScript>

     

    I don't understand how to include the rest that Tarun included. 

  • Inactive User's avatar
    Inactive User
    5 years ago

    MattV Tarun Any further advice? See previous entry. Can you spell this out for me?