API for discussion posts from one author?

Jump to solution
audrey_p
Community Participant

Hi, I'd like to help an instructor gather all of their posts and replies they made in every discussion in their course. This is so they can create a text library and use it for future commenting. Any help would be appreciated.

I figured I'd start smaller and try for one discussion. And then try the entire course. But, I got stuck with one discussion.

I see url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/view
shows the full topic per https://canvas.instructure.com/doc/api/discussion_topics.html. But I can't filter it down to one user. I tried 
url:GET|/api/v1/courses/:course_id/discussion_topics/:topic_id/view?user_id=xxx
and see no change. I still see other user's messages. 

In the meantime, I've shown them how to gather this information through Canvas' user interface and the related ideas in the past years. 

Labels (2)
0 Likes
1 Solution
JamesSekcienski
Community Contributor

It doesn't look like that endpoint supports filtering it to a single user's messages. 

However, if you use a script to make the API call, you could then loop over the replies and filter out those that don't match the user id of the user you want.  I haven't worked with this endpoint yet, but it looks like you will need to make sure you handle the nested replies within the views carefully to make sure you don't miss replies.

View solution in original post