Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filtering results from content API using metadata

Hi, we've been working on using the content API from Community to surface content on our website. One thing is the API doesn't allow you to filter the results based on metadata like Tags or Labels. We can only bring back the articles from a given Knowledge Base, and change the order based on Last Published, Most Viewed etc. Has anyone worked around this to then filter that list by use of a Label or such-like? We'd like to add a 'Hot Topic' label so that by default the list of content comes from the specific knowledge base, in order of Most Viewed or Last Published, but if an article has the 'Hot Topic' label then it comes first in the list. There may be one thing with this label or multiple.

2 Replies 2

@JMcJohnston - 


Did you mean filtering the articles using labels and tags?  If yes, this is feasible using API V2 calls. 


SELECT id FROM messages WHERE labels.text='Hot Topic'


SELECT id FROM messages WHERE tags.text = 'Hot Topics'



Give kudos if you find my posts helpful or mark solution if it answers your query.

Thanks for your reply @TariqHussain, but this doesn’t quite solve our problem.  If we were to filter by label, users would only see ‘hot topics’, whereas our  ideal solution is to have hot topics come first, then everything else from that knowledge base.


Ideally, we’d want to make a LiQL query such as:


SELECT view_href, title FROM messages WHERE conversation.type=”board” ORDER BY label, post_time DESC


…but ordering by more than one column isn’t supported by API V2 calls.  The only way to do it would be to have two API calls, one to grab the hot topics and one to grab any other topics, and that would have performance concerns.


Any ideas?

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.