Forum Discussion

jaread83's avatar
jaread83
Champion
8 years ago

List all posts where a user is mentioned

Hi,

Is it possible to get a list of community posts where a specific user is mentioned? Possibly your own user as part of the API call? I am looking into creating a new component on the profile page to show the last five posts where a user mentioned and then a new page to show a list of all posts where they are also mentioned (possibly with paging but I doubt that could be done).

Not sure if there is anything OOTB with this but willing to look into creating something if its possible to get the object out of the API to manipulate.

Thanks

4 Replies

  • jaread83

    Nice idea. But as per my knowledge, there is no such OOTB or API to get those messages. Also, let us know if you get something around.

  • jaread83 You can also try the notifications API. Since when someone mentions you, you will receive a notification. You can use /users/id/yourid/notifications
    And look for the mention type
    The logic can be, list 1000 notifications, and filter out the mentions type, in each mention object, you will find the message url.
  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Wow, good job peterlu. Actually, the match query approach is not a preferred one because to fetch those 5 mentioned messages we have to traverse too many messages. But notifications count will not be a big one as we need to fetch the notifications specific to that user.
    Also, I noticed from 17.9 that

    Maximum value for LIMIT in LiQL queries

    We have added a configuration which sets the maximum value allowed for LIMIT in LiQL queries to 1000. This is to help performance and protect against malicious attacks. If you need to raise this limit, contact Lithium Support.
    So ClaudiusH is Lithium supports to raise this limit in V1 also?