Forum Discussion

guays's avatar
guays
Helper
12 years ago

sorting by user's rank

Hi, I'm new with REST API and Freemarker.

 

I'm trying to do a widget that will get all the posts with no replies on a specific board. So far this is working well, but my problem is that I need to sort these posts according to the ranks of the users who posted them.

 

So I should see all the "New Members" posts first, then the "Members" posts and so on.

 

Is it possible do do that in only one REST API call?

 

Thank you,

Seb

6 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago

    Hey Seb,

    The API doesn't support ordering based on something other than message/thread date. You should be able to however to do this by iterating over the threads with no replies, retrieving the authors, and ordering it yourself based on the date that the member joined.

    You should also add your idea about ordering based on other parts of a message here: http://lithosphere.lithium.com/t5/customer-ideas/idb-p/Lithium_Ideas

    Thank you,

    Yuri

  • guays's avatar
    guays
    Helper
    12 years ago

    Thank you for the answer Yurik,

     

    I'm having problems finding what I need on this site, do you know the command to retrieve the user who posted a message?

     

    Thanks,
    Seb

  • guays's avatar
    guays
    Helper
    12 years ago

    I have another question.

     

    If I show ten posts, and for each of them I make a REST API request to know the user and the rank, will it affect the speed of the widget to have that much requests?

     

    Thanks,
    Seb

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

    You could mitigate that by creating an endpoint that makes these requests and creates the response XML you want, and then you could add caching in the endpoint.