Participation on Canvas Analytics API, call on the most current date

Jump to solution
jolvera
Community Explorer

Hello

Need some help when using the Analytics Canvas API.

For the participation endpoint - how can I just make a call with the latest creation date. When I make the call I get all the dates and participations ; but that is to much to loop for every student; I was wandering on a way to make some delta where I just call the end point where the date is greater than the last date I got.

Any help appreciated.

Labels (2)
1 Solution
James
Community Champion

 @jolvera  

Sorry, but that API endpoint doesn't support filtering by date.

Most endpoints do not. Some of the endpoints of the submissions API will allow you to specify things submitted or graded since a particular time, but that's the exception rather than the rule.

Maybe rethinking the process can help. For example, if you fetch the enrollments for a course, then it has a last_activity datetime. Activity is not participation, but if there is no activity, then there is unlikely to be participation. Perhaps you could fetch the enrollment data first and then use it to only fetch the participation data for those who have shown activity. You should cache this locally if you're going to do this, so that you have a complete record for everyone.

Another thing that can help with the time issue is using a programming language that allows for asynchronous API calls. I started off with PERL and PHP which were both synchronous (without special libraries I wasn't using) and it takes way longer than my more recent stuff that uses Node JS and JavaScript.

View solution in original post