- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not able to "Undelete" course using rest api endpoint
Hello all,
we are using PUT /v1/courses/{id} api endpoint to delete and undelete a course. but when we call the api with json
{"course":{"event":"undelete"}}
it gives 401(Unauthorized error). It is working fine before. Anyone know the workaround or any solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mpeterso,
I'm going to guess this happened because of the more granular permissions around course management that were included in the June Canvas release. For the account role your API user has, can you check out the account permissions and make sure all of the required ones are enabled (courses - undelete, course content - view and manage courses - delete), as outlined in the screenshot from the undelete permission here:
-Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @chriscas for the quick response. I have already checked and this permission doesn't are in consideration while we use rest api. I talked to canvas support as well. They replied, we are seeing a 401 error when trying to restore a course using the API. The 401 being seen will occur when a course has a SIS ID. When a course has a SIS ID, there are implicit assumption in Canvas that the course is managed by SIS (i.e. CSV uploads). As part of this, deleted courses with a SIS ID are intentionally disallowed from being updated via API. This is why 401 errors are being returned in this circumstance.
