[ARCHIVED] Deleted sections and the api conundrum

wre0001
Community Member

Our SIS integration is via the Canvas REST API.  Recently, it feels like the API has changed and it's causing us a headache.  So when an instructor/admin/etc. deletes a section in canvas it becomes unreachable from the API.  And, attempts to recreate these sections, even with "enable_sis_reactivation=true", fail.  

L2 Canvas support is telling us we need to create a csv file and use it to rename the sis_id of the deleted sections.  So our hands off automation via the API is now broken. We either have to manually, periodically create this section rename csv or parse our API sync logs to catch when these errors happen and generate a csv we load. Am I missing something or is this ridiculous?  "I feel like I am taking crazy pills" --Zoolander.

 

Test case:

We use the api to see if the section exists, the API says it doesn't because it's deleted.:
 
$ curl -H "${CANVAS_CURL_AUTH}" -s "https://uah.instructure.com/api/v1/sections/sis_section_id:202106_60001_01" 2>/dev/null | python -m json.tool
{
    "errors": [
        {
            "message": "The specified resource does not exist."
        }
    ]
}
 
 
We then try to create the section and get an error that it already exists.:
 
$ curl -H "${CANVAS_CURL_AUTH}" -X POST -F "course_section[sis_section_id]=202106_60001_01" -F "course_section[name]=OCS_000_01" -F "enable_sis_reactivation=true"  "https://uah.instructure.com/api/v1/courses/54724/sections"

{"errors":{"sis_source_id":[{"attribute":"sis_source_id","type":"SIS ID \"202106_60001_01\" is already in use","message":"SIS ID \"202106_60001_01\" is already in use"}]}}
 
William Eubank
University of Alabama in Huntsville
Labels (2)
0 Likes