The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
With regard to
https://canvas.instructure.com/doc/api/discussion_topics.html#method.discussion_topics.index
and the order_by=recent_activity - it appears to return results with the oldest posts first. Is there a way to reverse the order (and why would it do this!)?
/api/v1/courses/:course_id/discussion_topics?order_by=recent_activity
I got a feeling you already know but if it's an option to add a script to handle the data you can just use a JS .reverse() method on the data array.
Thank you. I hadn't thought about that, partly because this was for an MS Power Automate flow.
I would have to make a request, then extract the last page, and then request that if there are a lot of topics. I guess I could just request 100 results on the assumption that no sane course would have that many topics....but not sure that's a good assumption.
I went with the default order (by position) fwiw.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in