Register for InstructureCon25 • Passes include access to all sessions, the expo hall, entertainment and networking events, meals, and extraterrestrial encounters.
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
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
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.
To interact with Panda Bot in the Instructure Community, you need to sign up or log in:
Sign In
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.