Showing results for 
Show  only  | Search instead for 
Did you mean: 
Community Member

User's Visits on Discussion Forum thu API?


I am trying to get some data about users' visits on discussion forums such as the counts they visit certain forum topic and the counts they read certain forum posts.

I've read the API doc and am able to get their posting data such as their posts and meta info about the posts. I havn't found anything about their non-posting data.

Any suggestion? Does this require admin permission? Thanks!

Labels (4)
0 Kudos
3 Replies
Community Champion

You're probably going to have to use either the User Activity Stream endpoint or the Analytics endpoint and filter by user ID. With either, you'll have to do some serious filtering to get discussion views, especially because the Instructure definition of page view vs participation is...fuzzy.

Thank you so much, @bbennett2!

I tried the two GET functions you mentioned. Here is my quick notes and hope it will help more people potentially.

1. Using User Activity Stream I get my own activity stream or someone's when I have their access token. This is more than I expect so I'm glad that I tried it. However, I need others' activities and I don't have their tokens. I was wondering if I miss any method to get it.




-> I get the activity stream of the token's owner only


/api/v1/users/[student's user_id]/activity_stream?access_token=[teacher's access_token] 


 -> error 404

2. Using Analytics I get everyone's discussion forum visit counts. Yay! It aggregates the counts to certain degree (see picture below) but I can start from here. I need to validate it somehow. 

api/v1/courses/[course_id]/analytics/users/[user_id]/activity?access_token=[teacher's access token]

Screen Shot 2021-01-13 at 10.07.02 PM.png

Community Member

Correction: the request below won't give page views on specific pages. It only gives aggregated page views. I am sure it doesn't include discussion forum visit because the post time doesn't match the page views time period.

api/v1/courses/[course_id]/analytics/users/[user_id]/activity?access_token=[teacher's access token]
Tags (1)