Forum Discussion

bart777's avatar
bart777
Contributor
8 years ago

get mention by API

Hi all,

is it possible to get via API posts where user is mentioned? 

standard queries doesnt give results:

API v1

restapi/vc/search/messages?q=@username

API v2

SELECT * FROM messages WHERE body MATCHES "@username"

 

Rgds

 

 

 

  • ClaudiusH's avatar
    ClaudiusH
    Khoros Alumni (Retired)

    Using API v2 in the API browser I actually get results when searching for @mention. Are you URL encoding the search term in your code?

    Currently neither v1 nor v2 expose user mention as a dedicated metadata field that can be searched. So text search is the way.

    • allensmith81's avatar
      allensmith81
      Boss

      ClaudiusH

       

      Did we ever implement this? the problem with the above solution is it doesnt work so well in communities where the username is not unique (i.e. SSO communities) 

       

      Could really do with something like  Select * from messages where mention.uid = '<userid>'

       

       

      • ClaudiusH's avatar
        ClaudiusH
        Khoros Alumni (Retired)
        Currently there's no metadata added to messages to denote which users are mentioned in it. So there's currently no possibility to query for a certain mention data wise. You can only run the "@username" search.
        My understanding is that even with SSO communities the community username is unique. At least that was the case on a community I used to work on before :P

        Also: Do you mind sharing what experience you are trying to built? Are you thinking of an enhancement to the user profile page to list all mentions of that community member?