Discourse Likes API

I’m trying to integrate my discourse community to my project. I’m using ‘/post.json’ API to fetch the latest post. I also need to fetch the Likes of the post not only the count but also the user details who liked. Is there any API to fetch the likes of the Post/topics/comments.?

Like in https://meta.discourse.org/t/discourse-likes-api/249009.json?

You should check the above documentation. You get the details of users who liked a post by fetching the endpoint /post_action_users.json?id=POST_ID&post_action_type_id=2

5 Likes

Under every post there is a show more thing when i click that it shows the users who liked the post. I just took that API from network and called but that API did’t return time of the activity.

I think you might need a custom plugin to add that to the serializer.

Interestingly, if you have Reactions enabled you can use /discourse-reactions/posts/:post_id/reactions-users.json to get the created_at information for those (including for the reaction mapped to Like).

7 Likes

Wow! That’s a good catch, @JammyDodger!

3 Likes