tripp-bishop
11 years agoMentor
sorting REST call
Hi guys,
I'm trying to find out if/how I can sort the following REST call:
/blogs/id/myblog/topics?page=1&page_size=50&restapi.response_style=view
/blogs/id/myblog/topics?page=1&page_size=50&restapi.response_style=view
I've tried adding the following query params but with no luck:
&sort_by=topicpostdate
&sort_by=date
&sort.field=topicpostdate
&sort.field=date
I'm trying to get the oldest blogs in the blog for a report I'm building. I need to be able to sort to get at them. Looks like by default it's sorting in reverse chronological order, so I need the opposite of that. Does this call take a sorting param or am I out of luck?
Cheers
Hi tripp-bishop ,
I think the below REST call might help you.
/blogs/id/myblog/search/messages?q=is_root:true&sort_by=date
It searches for messages that are topics(root messages) within your blog and sorts them by date. I believe the date is in chronological order.
As a side note , If you need it in reverse chronological order , change the sort_by parameter to "sort_by=-date" .
PS : I have found sort_by parameter to work , usually with search calls .
Hope that helps.
Thanks,
Sam