How can I access previous year data using canvas LMS API?

Jump to solution
dileeshm
Community Member

I am looking for a way to access previous year data canvas LMS using API. I couldn't find a way to differentiate between current and previous year data.

0 Likes
1 Solution

@dileeshm 

Do you use enrollment terms by year?

If so, you could do the following:

  • Get all courses for that specific term
  • Then use a loop to go through each of those courses and do the following:
    • Get the enrollments for the course
      • Use the List enrollments endpoint.
      • Use the query parameters as you see fit based on the enrollments you want
      • *This could also be accomplished using a Provisioning report in the Account Reports section
    • Get the assignments for the course
      • Use the List assignments endpoint.
      • Use the query parameters as you see fit based on the assignments you want to include
    • Get the submissions for the course
      • Use the List submissions for multiple assignments endpoint with the student_ids[] query parameter set to "all".
      • Use additional query parameters as you see fit based on the submissions you want.  You can also specify certain assignment ids if you are only concerned with certain ones.

It is also important to keep in mind that this process can take a long time to complete with the API.  If you have access to Canvas Data, it may be more efficient to get it set-up and build reports using that instead of API.

View solution in original post