Hi everyone,
I came to this thread looking for a way to set and change the nicknames for some of my older courses. For organizational reasons, I wanted the nicknames to all use the same format but had a a couple of courses from a few years ago that didn't have nicknames, or had a different format to what I use now. I actually discovered it is possible to set or change the nickname of a course, even after the term has ended, by using the Canvas API. All you need to do is get an API access token from your profile settings (instructions here) and send an HTTP PUT request to your Canvas server for the specific course you want to change. I used this code for cURL to change my courses, but any tool capable of sending HTTPS requests should be fine:
curl 'https://<canvas>/api/v1/users/self/course_nicknames/<course_id>' \
-X PUT \
-F 'nickname=<nickname>' \
-H 'Authorization: Bearer <token>'
Simply replace <canvas> with your institution's URL, <course_id> with the Canvas course ID number, <nickname> with the nickname you want to use, and <token> with your personal access token. You can find the course ID in several ways, including hovering over the link to the course on the All Courses page, or simply visiting the course homepage in your browser and looking for the course ID in the address bar.
Although this API call will set or change the nickname on a course, if you just want to completely remove the nickname you can use this API call:
curl 'https://<canvas>/api/v1/users/self/course_nicknames/<course_id>' \
-X DELETE \
-H 'Authorization: Bearer <token>'
This will remove the nickname from the given course. There's also an API call that will remove all nicknames from all courses in one go. If you're interested, check out the documentation here.
I hope this helps!
Kind regards,
Josh