Content Migrations
API for accessing content migrations and migration issues
A MigrationIssue object looks like:
A ContentMigration object looks like:
A Migrator object looks like:
MigrationIssuesController#index
GET /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues
Scope: url:GET|/api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues
GET /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues
Scope: url:GET|/api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues
Returns paginated migration issues
Example Request:
Returns a list of MigrationIssue objects.
MigrationIssuesController#show
GET /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:GET|/api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
GET /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:GET|/api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
Returns data on an individual migration issue
Example Request:
Returns a MigrationIssue object.
MigrationIssuesController#update
PUT /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:PUT|/api/v1/accounts/:account_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:PUT|/api/v1/courses/:course_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:PUT|/api/v1/groups/:group_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
PUT /api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
Scope: url:PUT|/api/v1/users/:user_id/content_migrations/:content_migration_id/migration_issues/:id
Update the workflow_state of a migration issue
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | Set the workflow_state of the issue. Allowed values: |
Example Request:
Returns a MigrationIssue object.
ContentMigrationsController#index
GET /api/v1/accounts/:account_id/content_migrations
GET /api/v1/accounts/:account_id/content_migrations
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations
GET /api/v1/courses/:course_id/content_migrations
GET /api/v1/courses/:course_id/content_migrations
Scope: url:GET|/api/v1/courses/:course_id/content_migrations
GET /api/v1/groups/:group_id/content_migrations
GET /api/v1/groups/:group_id/content_migrations
Scope: url:GET|/api/v1/groups/:group_id/content_migrations
GET /api/v1/users/:user_id/content_migrations
GET /api/v1/users/:user_id/content_migrations
Scope: url:GET|/api/v1/users/:user_id/content_migrations
Returns paginated content migrations
Example Request:
Returns a list of ContentMigration objects.
ContentMigrationsController#show
GET /api/v1/accounts/:account_id/content_migrations/:id
GET /api/v1/accounts/:account_id/content_migrations/:id
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations/:id
GET /api/v1/courses/:course_id/content_migrations/:id
GET /api/v1/courses/:course_id/content_migrations/:id
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/:id
GET /api/v1/groups/:group_id/content_migrations/:id
GET /api/v1/groups/:group_id/content_migrations/:id
Scope: url:GET|/api/v1/groups/:group_id/content_migrations/:id
GET /api/v1/users/:user_id/content_migrations/:id
GET /api/v1/users/:user_id/content_migrations/:id
Scope: url:GET|/api/v1/users/:user_id/content_migrations/:id
Returns data on an individual content migration
Example Request:
Returns a ContentMigration object.
ContentMigrationsController#create
POST /api/v1/accounts/:account_id/content_migrations
POST /api/v1/accounts/:account_id/content_migrations
Scope: url:POST|/api/v1/accounts/:account_id/content_migrations
POST /api/v1/courses/:course_id/content_migrations
POST /api/v1/courses/:course_id/content_migrations
Scope: url:POST|/api/v1/courses/:course_id/content_migrations
POST /api/v1/groups/:group_id/content_migrations
POST /api/v1/groups/:group_id/content_migrations
Scope: url:POST|/api/v1/groups/:group_id/content_migrations
POST /api/v1/users/:user_id/content_migrations
POST /api/v1/users/:user_id/content_migrations
Scope: url:POST|/api/v1/users/:user_id/content_migrations
Create a content migration. If the migration requires a file to be uploaded the actual processing of the file will start once the file upload process is completed. File uploading works as described in the File Upload Documentation except that the values are set on a pre_attachment sub-hash.
For migrations that don’t require a file to be uploaded, like course copy, the processing will begin as soon as the migration is created.
You can use the Progress API to track the progress of the migration. The migration’s progress is linked to with the progress_url value.
The two general workflows are:
If no file upload is needed:
POST to create
Use the Progress specified in progress_url to monitor progress
For file uploading:
POST to create with file info in pre_attachment
Do file upload processing using the data in the pre_attachment data
GET the ContentMigration
Use the Progress specified in progress_url to monitor progress
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The type of the migration. Use the Migrator endpoint to see all available migrators. Default allowed values: canvas_cartridge_importer, common_cartridge_importer, course_copy_importer, zip_file_importer, qti_converter, moodle_converter |
|
| Required if uploading a file. This is the first step in uploading a file to the content migration. See the File Upload Documentation for details on the file upload workflow. |
|
| Other file upload properties, See File Upload Documentation |
|
| A URL to download the file from. Must not require authentication. |
|
| The id of a ContentExport to import. This allows you to import content previously exported from Canvas without needing to download and re-upload it. |
|
| The course to copy from for a course copy migration. (required if doing course copy) |
|
| The folder to unzip the .zip file into for a zip_file_import. |
|
| Whether to overwrite quizzes with the same identifiers between content packages. |
|
| The existing question bank ID to import questions into if not specified in the content package. |
|
| The question bank to import questions into if not specified in the content package, if both bank id and name are set, id will take precedence. |
|
| The id of a module in the target course. This will add all imported items (that can be added to a module) to the given module. |
|
| If provided (and Allowed values: |
|
| The (1-based) position to insert the imported items into the course (if |
|
| The id of an assignment group in the target course. If provided, all imported assignments will be moved to the given assignment group. |
|
| Set of importers to skip, even if otherwise selected by migration settings. Allowed values: |
|
| Import the “use as blueprint course” setting as well as the list of locked items from the source course or package. The destination course must not be associated with an existing blueprint course and cannot have any student or observer enrollments. |
|
| Whether to shift dates in the copied course |
|
| The original start date of the source content/course |
|
| The original end date of the source content/course |
|
| The new start date for the content/course |
|
| The new end date for the source content/course |
|
| Move anything scheduled for day ‘X’ to the specified day. (0-Sunday, 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday) |
|
| Whether to remove dates in the copied course. Cannot be used in conjunction with shift_dates. |
|
| If set, perform a selective import instead of importing all content. The migration will identify the contents of the package and then stop in the |
|
| For Allowed values: |
Example Request:
Returns a ContentMigration object.
ContentMigrationsController#update
PUT /api/v1/accounts/:account_id/content_migrations/:id
PUT /api/v1/accounts/:account_id/content_migrations/:id
Scope: url:PUT|/api/v1/accounts/:account_id/content_migrations/:id
PUT /api/v1/courses/:course_id/content_migrations/:id
PUT /api/v1/courses/:course_id/content_migrations/:id
Scope: url:PUT|/api/v1/courses/:course_id/content_migrations/:id
PUT /api/v1/groups/:group_id/content_migrations/:id
PUT /api/v1/groups/:group_id/content_migrations/:id
Scope: url:PUT|/api/v1/groups/:group_id/content_migrations/:id
PUT /api/v1/users/:user_id/content_migrations/:id
PUT /api/v1/users/:user_id/content_migrations/:id
Scope: url:PUT|/api/v1/users/:user_id/content_migrations/:id
Update a content migration. Takes same arguments as create except that you can’t change the migration type. However, changing most settings after the migration process has started will not do anything. Generally updating the content migration will be used when there is a file upload problem, or when importing content selectively. If the first upload has a problem you can supply new pre_attachment values to start the process again.
Returns a ContentMigration object.
ContentMigrationsController#available_migrators
GET /api/v1/accounts/:account_id/content_migrations/migrators
GET /api/v1/accounts/:account_id/content_migrations/migrators
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations/migrators
GET /api/v1/courses/:course_id/content_migrations/migrators
GET /api/v1/courses/:course_id/content_migrations/migrators
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/migrators
GET /api/v1/groups/:group_id/content_migrations/migrators
GET /api/v1/groups/:group_id/content_migrations/migrators
Scope: url:GET|/api/v1/groups/:group_id/content_migrations/migrators
GET /api/v1/users/:user_id/content_migrations/migrators
GET /api/v1/users/:user_id/content_migrations/migrators
Scope: url:GET|/api/v1/users/:user_id/content_migrations/migrators
Lists the currently available migration types. These values may change.
Returns a list of Migrator objects.
ContentMigrationsController#content_list
GET /api/v1/accounts/:account_id/content_migrations/:id/selective_data
GET /api/v1/accounts/:account_id/content_migrations/:id/selective_data
Scope: url:GET|/api/v1/accounts/:account_id/content_migrations/:id/selective_data
GET /api/v1/courses/:course_id/content_migrations/:id/selective_data
GET /api/v1/courses/:course_id/content_migrations/:id/selective_data
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/:id/selective_data
GET /api/v1/groups/:group_id/content_migrations/:id/selective_data
GET /api/v1/groups/:group_id/content_migrations/:id/selective_data
Scope: url:GET|/api/v1/groups/:group_id/content_migrations/:id/selective_data
GET /api/v1/users/:user_id/content_migrations/:id/selective_data
GET /api/v1/users/:user_id/content_migrations/:id/selective_data
Scope: url:GET|/api/v1/users/:user_id/content_migrations/:id/selective_data
Enumerates the content available for selective import in a tree structure. Each node provides a property
copy argument that can be supplied to the Update endpoint to selectively copy the content associated with that tree node and its children. Each node may also provide a sub_items_url
or an array of sub_items
which you can use to obtain copy parameters for a subset of the resources in a given node.
If no type
is sent you will get a list of the top-level sections in the content. It will look something like this:
When a type
is provided, nodes may be further divided via sub_items
. For example, using type=assignments results in a node for each assignment group and a sub_item for each assignment, like this:
To import the items corresponding to a particular tree node, use the property
as a parameter to the Update endpoint and assign a value of 1, for example:
You can include multiple copy parameters to selectively import multiple items or groups of items.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The type of content to enumerate. Allowed values: |
ContentMigrationsController#asset_id_mapping
GET /api/v1/courses/:course_id/content_migrations/:id/asset_id_mapping
GET /api/v1/courses/:course_id/content_migrations/:id/asset_id_mapping
Scope: url:GET|/api/v1/courses/:course_id/content_migrations/:id/asset_id_mapping
Given a complete course copy or blueprint import content migration, return a mapping of asset ids from the source course to the destination course that were copied in this migration or an earlier one with the same course pair and migration_type (course copy or blueprint).
The returned object’s keys are asset types as they appear in API URLs (announcements
, assignments
, discussion_topics
, files
, module_items
, modules
, pages
, and quizzes
). The values are a mapping from id in source course to id in destination course for objects of this type.
Example Request:
Example Response:
© Instructure, Inc. Generated on Wed Nov 6 14:20:05 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated