Using enable_sis_reactivation in Courses/Sections via API

Jump to solution
kfavara
Community Novice

I am trying to use the enable_sis_reactivation option for courses and sections, using the API. I have not previously marked the enable_sis_reactivation in courses or sections previous to using the API. I can use the GET to determine if a course/section is active. If it is not active, how do I find a deleted course/section using the API to know whether to update it or create it. I did not see the enable_sis_reactivation as a parameter in the API for update, but I can test that. But first, I need to determine whether it is deleted to know to PUT an update or PUSH to create. 

Any help from someone who has worked through this would be appreciated. I haven't gotten to users yet, but I will have the same questions there. 

Labels (1)
1 Solution
James
Community Champion

 @kfavara ,

Two things jump out at me.

The documentation for enable_sis_reactivation says

When true, will first try to re-activate a deleted section with matching sis_section_id if possible.

Notice the non-committal language there? "try" and "if possible". Maybe it isn't possible to reactivate the section you're trying to re-activate.

The second is what you're trying to send. I didn't test what you said you're sending, so I can't say for sure that it won't work.  However, I tested what the documentation says to send and it worked for me and what you're sending doesn't match the documentation I'm looking at so maybe we're looking in two places.

The URL you're using matches the Create course section endpoint of the Sections API. It's the same URL for Listing the sections, with a GET, but Create with a POST. You definitely need to be doing a POST.

I created a course by POSTing the following JSON to /api/v1/courses/2151246/sections

{
  "course_section":{
    "name":"test section",
    "sis_section_id":"m113beta-test01"
  },
}

It returned this object

240366_pastedImage_5.png

I then deleted it by sending a DELETE to /api/v1/sections/2416439

The section was deleted form my course.

Now I try to create the section again by doing a POST to /api/v1/courses/2151246/sections

This time the payload is

{
  "course_section":{
    "sis_section_id":"m113beta-test01"
  },
  "enable_sis_reactivation":true
}

And my section is back with the same Canvas section ID (2416439) that it had to start with.

View solution in original post