I need to change the Canvas sub-account for a batch of courses. Is there a way to do this through SIS import or the API? Thanks. I'm a bit new to this.
@CynthiaEdwards1
It is possible with both methods (I've done both!)
Preferably, you would use a SIS import to do this if your courses have a SIS ID, with the courses.csv format and changing the 'account_id' to match the correct subaccount SIS ID.
You can follow these instructions -- please try it out in your BETA instance first before you do it in your live instance, just in case there are any issues.
1) Make sure your subaccount has a SIS ID (go to Settings in the subaccount and give it one if it doesn't have one)
2) Go to the account where these courses live -> go to Settings -> Reports tab, then generate a SIS export of Courses (this makes it super easy to get the correctly formatted file and also not accidentally change any other attributes of the course)
3) Delete any courses that you don't want to change and then change the 'account_id' to match the target subaccount SIS ID
4) Save and upload the SIS import.
If your courses DO NOT have a SIS ID, you'll need to use the API (update a course). If you need sample code for this in Python, let me know.
@CynthiaEdwards1 We are using the SIS Import to reorganize all of our sub-accounts, but often need to use the API for some edge cases or research ahead of time.
@melodyc_lam If you have a demo script available to assist in the process, I would like to take a look. Anything that can help move the project along is always incredibly appreciated! (And, it would also dovetail very nicely with our internal clean up of old courses that live in accounts that are non-credit bearing and thus have no SIS, making the course status "deleted" very piecemeal.)
Hi melodyc_lam,
I am trying to use SIS import to reorganize our courses from one-subaccount to another. I am looking at your instruction#2 and wondering which reports on the admin I should download? is it the course.csv inside the provisioning report? or the SIS export report? Thanks! - Ernest
@ErnestChan The SIS Export Courses.csv will be the easiest, especially, from a specific sub account if that is what you're targeting. You can remove unecessary columns you don't use for provisioning if you want. The provisioning report would require removing the canvas_id for each column type. You might also consider whether you need to check include deleted objects if you want to empty a sub account, and if you have courses that do not have an SIS ID the provisioning report would be helpful to get a list of canvas_course_id's that don't have one, to manually fix… back to @melodyc_lam's comment that you'll need to use the API to add an SIS ID or to move the sub account for those.
https://developerdocs.instructure.com/services/canvas/sis/file.sis_csv#courses.csv
@ErnestChan Reports → SIS Export → Choose the term and then check off the box for Courses.csv to get the Courses report.
@cgaudreau Hey, this is a little late, but here's a script to "archive" courses based off a SIS Export report; it pulls the report directly from Canvas, processes it locally, then writes the result to a new file that then I can upload as a SIS Import. I don't have code to upload the file back through the SIS import system since the code was designed for beta usage but that can also be done through API calls so that you can build something that is fully automated.
Thanks for your wonderful information Robert. You mentioned that if we have courses that do not have SIS ID the provisioning report would be helpful to get a list of canvas_course_id's that don't have one to manually fix them. Could you explain this point more? In our school we have plenty of courses which do not created by SIS and do not have a SIS ID. The Canvas support team said we have to manually put a SIS ID to those courses before running courses.csv report if we would like to use SIS import to reassign course subaccount. The other alternative for this task is to use Canvas API with course ID. Thanks.
Hi @ErnestChan,
Based on your needs, you have a couple of options. If you just need to move some courses, maybe one time and be done with it, you could use the API to update the account_id for each of those courses. If you need to or have a desire to move the courses to another account, and have control of them through SIS Imports in the future, to rename them or move them, or update any of the other settings available through SIS Imports courses.csv, then, you can just add a unique sis_course_id to those courses, and then manage additional and future tasks through csv.
account_id
sis_course_id
Either way would start by getting that list of canvas_course_id's from the export report, and using the API endpoint for updating a course.
https://developerdocs.instructure.com/services/canvas/resources/courses#method.courses.update
If you have a favorite programming language, then you can choose how to loop through an array or csv file for the canvas_course_ids you need to update. Otherwise, you could use something like Postman to loop through a collection (csv file) and update the necessary value with the API. Here is some info on using Postman with CanvasAPI, although the screenshots might be a bit dated, the details should work.
Some more:
The LTI external tool we develop displays user avatars. These are taken from the LTI NRPS membership container, specifically the picture property for each class member (see the spec). Recently, the avatars for users who haven't uploaded a profile picture are broken. The issue is that the default avatar URL in the picture…
Hello, I'm building a standalone app that integrate with CanvasI) - What are the requirements (and cost if any) for receiving an API developer key issued by Instructure? - Are Instructure-issued keys enabled globally in all Canvas organizations? or will there need to be institution-by-institution enablement? Thanks
Hi everyone, I am seeking some insight into how Canvas LMS handles HTTP errors and how they are reflected in the logs versus the user interface. We are currently observing the following behavior in our environment: Log-only errors: We are seeing 500 (Internal Server Error) and 503 (Service Unavailable) errors recorded in…
I'm currently integrating an LTI tool and attempting to use the Activity.id.history https://canvas.instructure.com/doc/api/file.tools_variable_substitutions.html#activity-id-history variable, but I'm experiencing issues getting it to work properly. What I've Done: Added the Activity.id.history variable to my Developer…
I looked through the LTI Variable Substitutions documentation and while there are variable substitutions available for Canvas.term.name and Canvas.term.id (which is the Canvas incremented ID like "104"), I was surprised to see there was no option for Canvas.term.sisSourceId I tried testing other possible variants that may…