How to like a topic or post multiple times, using the same API key

(Fernando Melone) #1


I would like to know if it is possible for my integration to like a post more than just one time (as a toggle action).
For example, when people “like the topic” there’s a topic count accumulating, without the need for those people to be different, identified users of my Discourse instance.

I am doing an integration in Slack with Slack Buttons, and when people click “great answer!” or something like that, that answer now has an upvote.
But that user is interacting with Slack, I cannot force that user to be registered in my Discourse Instance.

I don’t know if this was clear, please let me know if you need further explanation of what I want to achieve!


(Sam Saffron) #2

Likes are always attached to users, a global api key can pretend to be multiple users by setting api_username so I guess you can do it, but you can not hand out anonymous likes.

(Fernando Melone) #3

Got it. I did not know that you could perform actions on behalf of the users like liking a post,by using the global api key and their username.

I guess one workaround would be to create the entire directory of users myself and then just match their identities with the ones in Slack?


(Sam Saffron) #4

I would not call that a workaround, I would call it the correct solution :innocent: