[REST API] Problem to sort messages
- 15 years ago
Looks like you want "/messages/linear" instead of "/messages/threaded". So, for your original example:
restapi/vc/threads/id/xxxxxxxx/messages/linear?page_size=10&page=8&message_viewer.message_sort_order=thread_ascending
The short answer:
If the board is being displayed in the UI as "Linear Format" (the default, and depending on setup, potentially the only view), linear would be the corresponding REST parameter. If it's "List by Topics", it's threaded.
The longer winded one:
Basically, linear mode displays a forum's replies in the order in which they were posted. In effect, all messages appear as replies to the one prior. Threaded mode displays them maintaining the hierarchy in which responses were made. For a smaller example, imagine a thread is started, message 2 and 3 are initiated as replies to the root, and message 4 is added as a reply to 2. The hierarchy would be:
1
|-2
|--4
|-3Admittedly, in a Forum only shown in the UI in linear mode, this REST result could be confusing.
Note that the sort order still applies, but the different views change the meaning of ascending/descending.