jsimon6 is looking for a way to retrieve mentions for a specific user via the Discourse API, to display them on a 3rd party site. j127 suggests using webhooks to scan post content for @-mentions. However, Falco provides a more direct solution: using the user_actions.json endpoint with the filter=7 parameter and the target username, e.g., https://meta.discourse.org/user_actions.json?offset=0&username=falco&filter=7. jsimon6 confirms this solution and suggests adding it to the documentation for clarity.
How can I get mentions for a specific user via the API? I have not found anything for this in the docs, and I can’t find anything in the source either.
We are wanting to show user mentions in our 3rd party site. Enough information should be obtainable via the API to allow the user to click on the mention and be taken to that particular topic.
Can this be done?
I found the notifications API endpoint, but this doesn’t give me any mentions.
I’m not sure if this is what you’re looking for, but I have my main forum post webhooks into a Firebase cloud function (any backend would work). If you do something like that, the backend could read the content of the posts, looking for @-mentions.
I use the webhooks to scan the content and post notifications to Slack when something needs attention on short notice.
OK. Thank you so much. That was it. I did try reverse engineering it, but I missed that one I think because it is not obvious by looking at that call that that is what is used to get mentions for a specific user.