How to get mentions for a specific user via the API?

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.

2 Likes

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.

That would be https://meta.discourse.org/user_actions.json?offset=0&username=falco&filter=7 where falco is the target username.

You can learn those API endpoints via How to reverse engineer the Discourse API

3 Likes

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.

It would be most helpful if that was in the docs!

1 Like