Showing results for 
Search instead for 
Did you mean: 
Surveyor II

Find section for deleted course

I'm writing an integration for our SIS system and I can't find a way to handle deleted courses properly.

The integration enrols students by getting the sections by their section_sis_id and then gets the course and if the status of the course is not completed makes the enrollment.

But if the course has been deleted the integration fails to get the section.

I would like to have the section and then the course and then check if course state is deleted, for the reason to handle this as OK instead of an failure.

Labels (3)
0 Kudos
3 Replies

When you get the course, it has a "workflow_state" property which tells you it's current availability. From the docs:

// the current state of the course one of 'unpublished', 'available',
// 'completed', or 'deleted'
"workflow_state": "available",


Surveyor II

Yes but in my case I dont have the course, the SIS integration works directly on sections and not courses. the reason for this is that section can be cross listed without noticing the SIS integration.

I need to get the section first by sis_section_id and then from the section get the course and then read the course state.


Ah, sorry.

The Section object from Canvas has a `course_id` value:

 // The unique Canvas identifier for the course in which the section belongs
  "course_id": 7,