Public
Advisor

Popular Forum Threads

Hello,

I'm searching in the API what could be the best option for find the most popular threads of a forum but I can't find it.

Could you help me?

Thanks,

Laurent

5 Replies 5
Honored Contributor

@lorseau

Here is the API to fetch the popular messages based on 

a) most views

Select * from messages order by metrics.views desc

b) most kudoed

Select * from messages order by kudos.sum(weight) desc

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

Thanks.

But it's about the "messages".

I found on the API V1 something with the thread but looks like it's not for the standard forums ("Used with Contest and Idea Exchange boards")

https://lithosphere.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-i...

Laurent

Honored Contributor

It is also for the forums. Here board means a forum. 

http://community.lithium.com/community-name/restapi/vc/boards/id/[id] /threads/popular

Or you can use this API as well

select * from messages order by popularity desc
Give kudos if you find my posts helpful or mark solution if it answers your query
Khoros Alumni (Retired)

This call also works on nodes that are not contest or idea exchange nodes, e.g. https://lithosphere.lithium.com/lithosphere/restapi/vc/boards/id/technology/threads/popular


Khoros Best Practice until August 2019. Onwards posting as Claudius.
Learn how to master Khoros. Learn Best Practice in the Community Documentation
If you appreciate my efforts, please give me a kudo ↓
Accept as solution to help others find it faster.
Khoros Alumni (Retired)

Just a clarification for the example by @VikasB for a API v2 LiQL query: 

Even if you restrict it to only the top level message of a thread by adding "WHERE depth = 0" to form the complete

SELECT * FROM messages WHERE depth = 0 ORDER BY popularity DESC

...you would get the most popular message starting a topic. It wouldn't be the most popular thread as a metrics over kudos given across all message within a thread. Currently I can't think of a way to achieve this using Community API v2.


Khoros Best Practice until August 2019. Onwards posting as Claudius.
Learn how to master Khoros. Learn Best Practice in the Community Documentation
If you appreciate my efforts, please give me a kudo ↓
Accept as solution to help others find it faster.

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.