Courses
API for accessing course information.
A Term object looks like:
A CourseProgress object looks like:
A Course object looks like:
A CalendarLink object looks like:
GET /api/v1/courses
GET /api/v1/courses
Scope: url:GET|/api/v1/courses
Returns the paginated list of active courses for the current user.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| When set, only return courses where the user is enrolled as this type. For example, set to “teacher” to return only courses where the user is enrolled as a Teacher. This argument is ignored if enrollment_role is given. Allowed values: |
|
| Deprecated When set, only return courses where the user is enrolled with the specified course-level role. This can be a role created with the Add Role API or a base role type of ‘StudentEnrollment’, ‘TeacherEnrollment’, ‘TaEnrollment’, ‘ObserverEnrollment’, or ‘DesignerEnrollment’. |
|
| When set, only return courses where the user is enrolled with the specified course-level role. This can be a role created with the Add Role API or a built_in role type of ‘StudentEnrollment’, ‘TeacherEnrollment’, ‘TaEnrollment’, ‘ObserverEnrollment’, or ‘DesignerEnrollment’. |
|
| When set, only return courses where the user has an enrollment with the given state. This will respect section/course/term date overrides. Allowed values: |
|
| When set, only return courses that are not configured as blueprint courses. |
|
|
Allowed values: |
|
| If set, only return courses that are in the given state(s). By default, “available” is returned for students and observers, and anything except “deleted”, for all other enrollment types Allowed values: |
Returns a list of Course objects.
GET /api/v1/users/:user_id/courses
GET /api/v1/users/:user_id/courses
Scope: url:GET|/api/v1/users/:user_id/courses
Returns a paginated list of active courses for this user. To view the course list for a user other than yourself, you must be either an observer of that user or an administrator.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
|
Allowed values: |
|
| If set, only return courses that are in the given state(s). By default, “available” is returned for students and observers, and anything except “deleted”, for all other enrollment types Allowed values: |
|
| When set, only return courses where the user has an enrollment with the given state. This will respect section/course/term date overrides. Allowed values: |
|
| If set, only return homeroom courses. |
|
| If set, only include courses associated with this account |
Returns a list of Course objects.
CoursesController#user_progress
GET /api/v1/courses/:course_id/users/:user_id/progress
GET /api/v1/courses/:course_id/users/:user_id/progress
Scope: url:GET|/api/v1/courses/:course_id/users/:user_id/progress
Return progress information for the user and course
You can supply self
as the user_id to query your own progress in a course. To query another user’s progress, you must be a teacher in the course, an administrator, or a linked observer of the user.
Returns a CourseProgress object.
POST /api/v1/accounts/:account_id/courses
POST /api/v1/accounts/:account_id/courses
Scope: url:POST|/api/v1/accounts/:account_id/courses
Create a new course
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The name of the course. If omitted, the course will be named “Unnamed Course.” |
|
| The course code for the course. |
|
| Course start date in ISO8601 format, e.g. 2011-01-01T01:00Z This value is ignored unless ‘restrict_enrollments_to_course_dates’ is set to true. |
|
| Course end date in ISO8601 format. e.g. 2011-01-01T01:00Z This value is ignored unless ‘restrict_enrollments_to_course_dates’ is set to true. |
|
| The name of the licensing. Should be one of the following abbreviations (a descriptive name is included in parenthesis for reference):
|
|
| Set to true if course is public to both authenticated and unauthenticated users. |
|
| Set to true if course is public only to authenticated users. |
|
| Set to true to make the course syllabus public. |
|
| Set to true to make the course syllabus public for authenticated users. |
|
| A publicly visible description of the course. |
|
| If true, students will be able to modify the course wiki. |
|
| If true, course members will be able to comment on wiki pages. |
|
| If true, students can attach files to forum posts. |
|
| Set to true if the course is open enrollment. |
|
| Set to true if the course is self enrollment. |
|
| Set to true to restrict user enrollments to the start and end dates of the course. This value must be set to true in order to specify a course start date and/or end date. |
|
| The unique ID of the term to create to course in. |
|
| The unique SIS identifier. |
|
| The unique Integration identifier. |
|
| If this option is set to true, the totals in student grades summary will be hidden. |
|
| Set to true to weight final grade based on assignment groups percentages. |
|
| The time zone for the course. Allowed time zones are IANA time zones or friendlier Ruby on Rails time zones. |
|
| If this option is set to true, the course will be available to students immediately. |
|
| Set to true to enroll the current user as the teacher. |
|
| The type of page that users will see when they first visit the course
other types may be added in the future Allowed values: |
|
| The syllabus body for the course |
|
| The grading standard id to set for the course. If no value is provided for this argument the current grading_standard will be un-set from this course. |
|
| Optional. The grade_passback_setting for the course. Only ‘nightly_sync’, ‘disabled’, and ” are allowed |
|
| Optional. Specifies the format of the course. (Should be ‘on_campus’, ‘online’, or ‘blended’) |
|
| Default is false. When true, all grades in the course must be posted manually, and will not be automatically posted. When false, all grades in the course will be automatically posted. |
|
| When true, will first try to re-activate a deleted course with matching sis_course_id if possible. |
Returns a Course object.
POST /api/v1/courses/:course_id/files
POST /api/v1/courses/:course_id/files
Scope: url:POST|/api/v1/courses/:course_id/files
Upload a file to the course.
This API endpoint is the first step in uploading a file to a course. See the File Upload Documentation for details on the file upload workflow.
Only those with the “Manage Files” permission on a course can upload files to the course. By default, this is Teachers, TAs and Designers.
GET /api/v1/courses/:course_id/students
GET /api/v1/courses/:course_id/students
Scope: url:GET|/api/v1/courses/:course_id/students
Returns the paginated list of students enrolled in this course.
DEPRECATED: Please use the course users endpoint and pass “student” as the enrollment_type.
Returns a list of User objects.
GET /api/v1/courses/:course_id/users
GET /api/v1/courses/:course_id/users
Scope: url:GET|/api/v1/courses/:course_id/users
GET /api/v1/courses/:course_id/search_users
GET /api/v1/courses/:course_id/search_users
Scope: url:GET|/api/v1/courses/:course_id/search_users
Returns the paginated list of users in this course. And optionally the user’s enrollments in the course.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The partial name or full ID of the users to match and return in the results list. |
|
| When set, sort the results of the search based on the given field. Allowed values: |
|
| When set, only return users where the user is enrolled as this type. “student_view” implies include[]=test_student. This argument is ignored if enrollment_role is given. Allowed values: |
|
| Deprecated When set, only return users enrolled with the specified course-level role. This can be a role created with the Add Role API or a base role type of ‘StudentEnrollment’, ‘TeacherEnrollment’, ‘TaEnrollment’, ‘ObserverEnrollment’, or ‘DesignerEnrollment’. |
|
| When set, only return courses where the user is enrolled with the specified course-level role. This can be a role created with the Add Role API or a built_in role id with type ‘StudentEnrollment’, ‘TeacherEnrollment’, ‘TaEnrollment’, ‘ObserverEnrollment’, or ‘DesignerEnrollment’. |
|
|
Optionally include with each Course the user’s current and invited enrollments. If the user is enrolled as a student, and the account has permission to manage or view all grades, each enrollment will include a ‘grades’ key with ‘current_score’, ‘final_score’, ‘current_grade’ and ‘final_grade’ values.
if present. Default is to not include Test Student.
such as analytics information
well as this directive, the scores returned in the enrollment will be for the current grading period if there is one. A ‘grading_period_id’ value will also be included with the scores. if grading_period_id is nil there is no current grading period and the score is a total score.
Allowed values: |
|
| If this parameter is given and it corresponds to a user in the course, the |
|
| If included, the course users set will only include users with IDs specified by the param. Note: this will not work in conjunction with the “user_id” argument but multiple user_ids can be included. |
|
| When set, only return users where the enrollment workflow state is of one of the given types. “active” and “invited” enrollments are returned by default. Allowed values: |
Returns a list of User objects.
CoursesController#recent_students
GET /api/v1/courses/:course_id/recent_students
GET /api/v1/courses/:course_id/recent_students
Scope: url:GET|/api/v1/courses/:course_id/recent_students
Returns the paginated list of users in this course, ordered by how recently they have logged in. The records include the ‘last_login’ field which contains a timestamp of the last time that user logged into canvas. The querying user must have the ‘View usage reports’ permission.
Example Request:
Returns a list of User objects.
GET /api/v1/courses/:course_id/users/:id
GET /api/v1/courses/:course_id/users/:id
Scope: url:GET|/api/v1/courses/:course_id/users/:id
Return information on a single user.
Accepts the same include[] parameters as the :users: action, and returns a single user with the same fields as that action.
Returns an User object.
CoursesController#content_share_users
GET /api/v1/courses/:course_id/content_share_users
GET /api/v1/courses/:course_id/content_share_users
Scope: url:GET|/api/v1/courses/:course_id/content_share_users
Returns a paginated list of users you can share content with. Requires the content share feature and the user must have the manage content permission for the course.
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | Term used to find users. Will search available share users with the search term in their name. |
Example Request:
Returns a list of User objects.
CoursesController#preview_html
POST /api/v1/courses/:course_id/preview_html
POST /api/v1/courses/:course_id/preview_html
Scope: url:POST|/api/v1/courses/:course_id/preview_html
Preview html content processed for this course
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The html content to process |
Example Request:
Example Response:
CoursesController#activity_stream
GET /api/v1/courses/:course_id/activity_stream
GET /api/v1/courses/:course_id/activity_stream
Scope: url:GET|/api/v1/courses/:course_id/activity_stream
Returns the current user’s course-specific activity stream, paginated.
For full documentation, see the API documentation for the user activity stream, in the user api.
CoursesController#activity_stream_summary
GET /api/v1/courses/:course_id/activity_stream/summary
GET /api/v1/courses/:course_id/activity_stream/summary
Scope: url:GET|/api/v1/courses/:course_id/activity_stream/summary
Returns a summary of the current user’s course-specific activity stream.
For full documentation, see the API documentation for the user activity stream summary, in the user api.
GET /api/v1/courses/:course_id/todo
GET /api/v1/courses/:course_id/todo
Scope: url:GET|/api/v1/courses/:course_id/todo
Returns the current user’s course-specific todo items.
For full documentation, see the API documentation for the user todo items, in the user api.
DELETE /api/v1/courses/:id
DELETE /api/v1/courses/:id
Scope: url:DELETE|/api/v1/courses/:id
Delete or conclude an existing course
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The action to take on the course. Allowed values: |
Example Response:
CoursesController#api_settings
GET /api/v1/courses/:course_id/settings
GET /api/v1/courses/:course_id/settings
Scope: url:GET|/api/v1/courses/:course_id/settings
Returns some of a course’s settings.
Example Request:
Example Response:
CoursesController#update_settings
PUT /api/v1/courses/:course_id/settings
PUT /api/v1/courses/:course_id/settings
Scope: url:PUT|/api/v1/courses/:course_id/settings
Can update the following course settings:
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Let student final grades for a grading period or the total grades for the course be overridden |
|
| Let students create discussion topics |
|
| Let students attach files to discussions |
|
| Let students edit or delete their own discussion replies |
|
| Let students organize their own groups |
|
| Let students report offensive discussion content |
|
| Let students create anonymous discussion topics |
|
| Filter SpeedGrader to only the selected student group |
|
| Hide totals in student grades summary |
|
| Hide grade distribution graphs from students |
|
| Disallow students from viewing students in sections they do not belong to |
|
| Disable comments on announcements |
|
| Copyright and license information must be provided for files before they are published. |
|
| Restrict students from viewing courses after end date |
|
| Restrict students from viewing courses before start date |
|
| Show the most recent announcements on the Course home page (if a Wiki, defaults to five announcements, configurable via home_page_announcement_limit). Canvas for Elementary subjects ignore this setting. |
|
| Limit the number of announcements on the home page if enabled via show_announcements_on_home_page |
|
| Show the course summary (list of assignments and calendar events) on the syllabus page. Default is true. |
|
| Set the default due time for assignments. This is the time that will be pre-selected in the Canvas user interface when setting a due date for an assignment. It does not change when any existing assignment is due. It should be given in 24-hour HH:MM:SS format. The default is “23:59:59”. Use “inherit” to inherit the account setting. |
|
| Enable or disable individual learning paths for students based on assessment |
Example Request:
CoursesController#student_view_student
GET /api/v1/courses/:course_id/student_view_student
GET /api/v1/courses/:course_id/student_view_student
Scope: url:GET|/api/v1/courses/:course_id/student_view_student
Returns information for a test student in this course. Creates a test student if one does not already exist for the course. The caller must have permission to access the course’s student view.
Example Request:
Returns an User object.
GET /api/v1/courses/:id
GET /api/v1/courses/:id
Scope: url:GET|/api/v1/courses/:id
GET /api/v1/accounts/:account_id/courses/:id
GET /api/v1/accounts/:account_id/courses/:id
Scope: url:GET|/api/v1/accounts/:account_id/courses/:id
Return information on a single course.
Accepts the same include[] parameters as the list action plus:
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
|
Allowed values: |
|
| The maximum number of teacher enrollments to show. If the course contains more teachers than this, instead of giving the teacher enrollments, the count of teachers will be given under a teacher_count key. |
Returns a Course object.
PUT /api/v1/courses/:id
PUT /api/v1/courses/:id
Scope: url:PUT|/api/v1/courses/:id
Update an existing course.
Arguments are the same as Courses#create, with a few exceptions (enroll_me).
If a user has content management rights, but not full course editing rights, the only attribute editable through this endpoint will be “syllabus_body”
If an account has set prevent_course_availability_editing_by_teachers, a teacher cannot change course, course, or course here.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| The unique ID of the account to move the course to. |
|
| The name of the course. If omitted, the course will be named “Unnamed Course.” |
|
| The course code for the course. |
|
| Course start date in ISO8601 format, e.g. 2011-01-01T01:00Z This value is ignored unless ‘restrict_enrollments_to_course_dates’ is set to true, or the course is already published. |
|
| Course end date in ISO8601 format. e.g. 2011-01-01T01:00Z This value is ignored unless ‘restrict_enrollments_to_course_dates’ is set to true. |
|
| The name of the licensing. Should be one of the following abbreviations (a descriptive name is included in parenthesis for reference):
|
|
| Set to true if course is public to both authenticated and unauthenticated users. |
|
| Set to true if course is public only to authenticated users. |
|
| Set to true to make the course syllabus public. |
|
| Set to true to make the course syllabus to public for authenticated users. |
|
| A publicly visible description of the course. |
|
| If true, students will be able to modify the course wiki. |
|
| If true, course members will be able to comment on wiki pages. |
|
| If true, students can attach files to forum posts. |
|
| Set to true if the course is open enrollment. |
|
| Set to true if the course is self enrollment. |
|
| Set to true to restrict user enrollments to the start and end dates of the course. Setting this value to false will remove the course end date (if it exists), as well as the course start date (if the course is unpublished). |
|
| The unique ID of the term to create to course in. |
|
| The unique SIS identifier. |
|
| The unique Integration identifier. |
|
| If this option is set to true, the totals in student grades summary will be hidden. |
|
| The time zone for the course. Allowed time zones are IANA time zones or friendlier Ruby on Rails time zones. |
|
| Set to true to weight final grade based on assignment groups percentages. |
|
| Set the storage quota for the course, in megabytes. The caller must have the “Manage storage quotas” account permission. |
|
| If this option is set to true, the course will be available to students immediately. |
|
| The action to take on each course.
Allowed values: |
|
| The type of page that users will see when they first visit the course
other types may be added in the future Allowed values: |
|
| The syllabus body for the course |
|
| Optional. Indicates whether the Course Summary (consisting of the course’s assignments and calendar events) is displayed on the syllabus page. Defaults to |
|
| The grading standard id to set for the course. If no value is provided for this argument the current grading_standard will be un-set from this course. |
|
| Optional. The grade_passback_setting for the course. Only ‘nightly_sync’ and ” are allowed |
|
| Optional. Specifies the format of the course. (Should be either ‘on_campus’ or ‘online’) |
|
| This is a file ID corresponding to an image file in the course that will be used as the course image. This will clear the course’s image_url setting if set. If you attempt to provide image_url and image_id in a request it will fail. |
|
| This is a URL to an image to be used as the course image. This will clear the course’s image_id setting if set. If you attempt to provide image_url and image_id in a request it will fail. |
|
| If this option is set to true, the course image url and course image ID are both set to nil |
|
| If this option is set to true, the course banner image url and course banner image ID are both set to nil |
|
| Sets the course as a blueprint course. |
|
| Sets a default set to apply to blueprint course objects when restricted, unless use_blueprint_restrictions_by_object_type is enabled. See the Blueprint Restriction documentation |
|
| When enabled, the blueprint_restrictions parameter will be ignored in favor of the blueprint_restrictions_by_object_type parameter |
|
| Allows setting multiple Blueprint Restriction to apply to blueprint course objects of the matching type when restricted. The possible object types are “assignment”, “attachment”, “discussion_topic”, “quiz” and “wiki_page”. Example usage:
|
|
| Sets the course as a homeroom course. The setting takes effect only when the course is associated with a Canvas for Elementary-enabled account. |
|
| Syncs enrollments from the homeroom that is set in homeroom_course_id. The setting only takes effect when the course is associated with a Canvas for Elementary-enabled account and sync_enrollments_from_homeroom is enabled. |
|
| Sets the Homeroom Course id to be used with sync_enrollments_from_homeroom. The setting only takes effect when the course is associated with a Canvas for Elementary-enabled account and sync_enrollments_from_homeroom is enabled. |
|
| Enable or disable the course as a template that can be selected by an account |
|
| Sets a color in hex code format to be associated with the course. The setting takes effect only when the course is associated with a Canvas for Elementary-enabled account. |
|
| Set a friendly name for the course. If this is provided and the course is associated with a Canvas for Elementary account, it will be shown instead of the course name. This setting takes priority over course nicknames defined by individual users. |
|
| Enable or disable Course Pacing for the course. This setting only has an effect when the Course Pacing feature flag is enabled for the sub-account. Otherwise, Course Pacing are always disabled.
|
|
| Enable or disable individual learning paths for students based on assessment |
|
| When true, all grades in the course will be posted manually. When false, all grades in the course will be automatically posted. Use with caution as this setting will override any assignment level post policy. |
|
| Default is true. If false, any fields containing “sticky” changes will not be updated. See SIS CSV Format documentation for information on which fields can have SIS stickiness |
Example Request:
Example Response:
CoursesController#batch_update
PUT /api/v1/accounts/:account_id/courses
PUT /api/v1/accounts/:account_id/courses
Scope: url:PUT|/api/v1/accounts/:account_id/courses
Update multiple courses in an account. Operates asynchronously; use the progress endpoint to query the status of an operation.
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | List of ids of courses to update. At most 500 courses may be updated in one call. |
| Required | The action to take on each course. Must be one of ‘offer’, ‘conclude’, ‘delete’, or ‘undelete’.
Allowed values: |
Example Request:
Returns a Progress object.
CoursesController#reset_content
POST /api/v1/courses/:course_id/reset_content
POST /api/v1/courses/:course_id/reset_content
Scope: url:POST|/api/v1/courses/:course_id/reset_content
Deletes the current course, and creates a new equivalent course with no content, but all sections and users moved over.
Returns a Course object.
CoursesController#effective_due_dates
GET /api/v1/courses/:course_id/effective_due_dates
GET /api/v1/courses/:course_id/effective_due_dates
Scope: url:GET|/api/v1/courses/:course_id/effective_due_dates
For each assignment in the course, returns each assigned student’s ID and their corresponding due date along with some grading period data. Returns a collection with keys representing assignment IDs and values as a collection containing keys representing student IDs and values representing the student’s effective due_at, the grading_period_id of which the due_at falls in, and whether or not the grading period is closed (in_closed_grading_period)
The list of assignment IDs for which effective student due dates are requested. If not provided, all assignments in the course will be used.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| no description |
Example Request:
Example Response:
GET /api/v1/courses/:course_id/permissions
GET /api/v1/courses/:course_id/permissions
Scope: url:GET|/api/v1/courses/:course_id/permissions
Returns permission information for the calling user in the given course. See also the Account and Group counterparts.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| List of permissions to check against the authenticated user. Permission names are documented in the Create a role endpoint. |
Example Request:
Example Response:
CoursesController#bulk_user_progress
GET /api/v1/courses/:course_id/bulk_user_progress
GET /api/v1/courses/:course_id/bulk_user_progress
Scope: url:GET|/api/v1/courses/:course_id/bulk_user_progress
Returns progress information for all users enrolled in the given course.
You must be a user who has permission to view all grades in the course (such as a teacher or administrator).
Example Request:
Example Response:
CoursesController#dismiss_migration_limitation_msg
POST /api/v1/courses/:id/dismiss_migration_limitation_message
POST /api/v1/courses/:id/dismiss_migration_limitation_message
Scope: url:POST|/api/v1/courses/:id/dismiss_migration_limitation_message
Remove alert about the limitations of quiz migrations that is displayed to a user in a course
you must be logged in to use this endpoint
Example Response:
ContentImportsController#copy_course_status
GET /api/v1/courses/:course_id/course_copy/:id
GET /api/v1/courses/:course_id/course_copy/:id
Scope: url:GET|/api/v1/courses/:course_id/course_copy/:id
DEPRECATED: Please use the Content Migrations API
Retrieve the status of a course copy
API response field:
id
The unique identifier for the course copy.
created_at
The time that the copy was initiated.
progress
The progress of the copy as an integer. It is null before the copying starts, and 100 when finished.
workflow_state
The current status of the course copy. Possible values: “created”, “started”, “completed”, “failed”
status_url
The url for the course copy status API endpoint.
Example Response:
ContentImportsController#copy_course_content
POST /api/v1/courses/:course_id/course_copy
POST /api/v1/courses/:course_id/course_copy
Scope: url:POST|/api/v1/courses/:course_id/course_copy
DEPRECATED: Please use the Content Migrations API
Copies content from one course into another. The default is to copy all course content. You can control specific types to copy by using either the ‘except’ option or the ‘only’ option.
The response is the same as the course copy status endpoint
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| ID or SIS-ID of the course to copy the content from |
|
| A list of the course content types to exclude, all areas not listed will be copied. Allowed values: |
|
| A list of the course content types to copy, all areas not listed will not be copied. Allowed values: |
© Instructure, Inc. Generated on Wed Nov 6 14:20:06 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated