Forum Discussion

janisgarklavs's avatar
7 years ago

Kudos via AJAX

Hi,

 

I wanted to see your opinion what is better option,

We have custom kudo giving icon on messages, and there are currently two options to give kudo to message.

Either through javascript ajax straight to "restapi/vc/messages/id/{messagID}/kudos/give" however this requires to set permissions for regular users be able to modify via rest calls.

Other option would be custom endpoint where it is done in freemarker context and call this endpoint through ajax.

 

What do you think is better? Is it safe to enable Make REST API calls with modify access ?

  • janisgarklavs - Go with the second approach. Also, enabling Make REST API calls with modify access  should not wreck a havoc in anyways, but if you are concerned, go with the second option. 

  • janisgarklavs - Go with the second approach. Also, enabling Make REST API calls with modify access  should not wreck a havoc in anyways, but if you are concerned, go with the second option. 

    • saideepak's avatar
      saideepak
      Contributor

      VarunGrazitti  how do i pass the message id of the kudo (to which it belongs to) through "component liaaddscript" to endpoint?  Becasuse through page.context.message.uniqueId, i get the message id and that value can be obtained after the click event which is part of liaaddscript. i cannot make rest calls in liaaddscript. so how to solve it? can i call rest calls inside liaaddscript after the user event happened?