Forum Discussion

Dromanchik's avatar
12 years ago

REST API: how to get community threads sorted by latest post date?

Hi guys,

 

How can I get community threads (or topics) sorted by most recent posts (with each thread appearing only once)?

I have tried

/restapi/vc/threads/recent?topic_sort_order=last_post_date

/restapi/vc/topics/streams/key/by-latest-post/after

It doesn't works.


Can you help me with it?


Thanks.

 

6 Replies

  • Hey,

    The /restapi/vc/threads/recent call by itself should return a list of the recent threads  sorted by the post date of the thread topic, descending. You should not require any extra sorting.

    Hope this helps. Let me know if you want to get some different result.

    Thanks,
    Chhama

  • ChhamaJ. Thanks for the answer.

    But I still want to get "community threads sorted by most recent posts".
    I need the threads to be sorted by message post date (or reply, or comment) rather than topic post date.

  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff
    12 years ago

    Try this

     

    /restapi/vc/boards/id/[board-id]/threads/top

     

    This should work. Let me know if this is not what you want.

     

    Thanks,
    Chhama

  • ChhamaJ. Thanks for the answer.

    But I still need to get "Community threads".
    I need the Community threads rather than Board threads, Blog threads or Category threads. (i.e. top of all available threads in the Community).

  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff
    12 years ago

    Sorry about the confusion. It seems like we do not support this call at a community level but only at a board level. Could you please add this to our customer idea exchange? Customer Ideas

     

    Regards,
    Chhama

  • KaelaC's avatar
    KaelaC
    Lithium Alumni (Retired)
    12 years ago

    There is also the option of using the steams API with the "by-latest-post" key.  However, using this does involve a Lithium controlled configuration to even be available.  If you want to use streams, contact support.