Forum Discussion
Here is an example with the Lithosphere that might be simpler to explain my problem this way:
Topic:
Message 11 - ID: 4935 - Author: spike
Message 12 - ID: 4953 - Author: Jason
Message 13 - ID: 4962 - Author: Rho
Message 14 - ID: 4971 - Author: jloyless
Message 15 - ID: 4975 - Author: PaulGi
Message 16 - ID: 6244 - Author: JuhisH
Query which should get the same result: (as far as I understood)
Message 11 - ID: 4962 - Author: Rho
Message 12 - ID: 4971 - Author: jloyless
Message 13 - ID: 4975 - Author: PaulGi
Message 14 - ID: 6244 - Author: jloyless
Message 15 - ID: 4935 - Author: spike
Message 16 - ID: 4953 - Author: Jason
- Elixor15 years agoAce
Hi,
Sorry to up this topic, anyone would have an idea?
- LyleF15 years agoLithium Alumni (Retired)
I'm not the API expert, but it seems like the call you want is /messages/linear, which returns messages in chronological order vs /messages/threaded which returns messages in the order of nested replies (used to build a tree).
Hope that helps..
- EricH15 years agoLithium Alumni (Retired)
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.
- Elixor15 years agoAce
This is great thank you very much.
I tried it as linear and it does work as I wanted it to work.
Thanks you very much for the answers and the explanations, it actually makes a lot of sense now.