wjlane
Community Participant

Getting section assignments dates from the API

Hi all,

I'm new to Canvas and just finding my way around so hoping I'm missing something and there is a more straight forward solution to my issue.

We have a dashboard in our schools website showing things like todays timetable and upcoming assignments. A problem we have is that some teachers use sections for different classes and their assignments have different due dates. A search through the API using 'courses/course_id/assignments' returns the assignment due date which isn't the same as the due date set in some of the sections for this course.  I have found I can get to this information but it requires the following seperate requests from the API which add considerably to the page load time :

  • Get all assignments for a course
    • courses/course_id/assignments
  • Get the sections for the course with a list of students (to work out our current students section)
    • courses/course_id/sections?include[]=students
  • Get the individual assignment because courses/course_id/assignments doesn't return all_dates
    • courses/course_id/assignments/assignment_id?all_dates=true 

That provides all the data required to find a students actual due date.  I'm hoping there is a more direct path to this that I'm missing.  

0 Kudos
1 Reply
wjlane
Community Participant

Digging deeper into this with  @sadenniston  we found an odd thing with the 'courses/course_id/assignments' endpoints.  When you set alternative delivery dates for sections or individual users the api sets the use date for the assignment to the last of these overrides.  Therefore setting a longer due date for one student means the api will return that longer date as the due_date for the assignment for everyone (if it was the last added).  Which seems to be exactly what you aren't trying to achieve by giving a student an extension.  Has anyone else encountered this?