Forum Discussion

alex's avatar
alex
Contributor
13 years ago

About the sorting question of the message

Hi all,

 

At one category, I use '/restapi/vc/categories/id/45/search/messages' to get messages and it is successful.

But I don't know how to sort the result.

 

What can be alphabetical or other?

 

2 Replies

  • Hi Alex,
    According to the REST API documentation the community search takes an optional "sort_by" parameter which is a string. But I couldn't find any further documentation about which strings are available here. I would guess it's "date", "relevance" or something like that.
  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    The sort_by parameter actually accepts the same values as in the UI. So if you go to the search page and choose one of the sorting options, you can view the value of the sort_by parameter in your browser's address bar. 

     

    I hope this helps!

     

    -Adam