Forum Discussion

phani's avatar
phani
Advisor
10 years ago

API call to find latest post of subscribed Label

Hi,

 

Iam trying to find out recent posts in community based on Label.

Can you please help me to find out API call using rest api or LIQL.

 

Thanks,

Phani

2 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    10 years ago

    Hi Phani,

     

    You should be able to make a call like this:

    /restapi/vc/posts/for/labels/text/Twitter/recent

     

    In this case, you'd get back recent posts that are labeled "Twitter".

     

    I hope this helps!

  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    10 years ago
    If you just need messages with one label, you can use the following in LiQL: SELECT * FROM messages WHERE labels.text = 'label' ORDER BY post_time DESC

    For multiple label search, use: SELECT * FROM messages WHERE labels.text IN ('label1', 'label2') ORDER BY post_time DESC