Sections API
API for accessing section information.
A Section object looks like:
{
// The unique identifier for the section.
"id": 1,
// The name of the section.
"name": "Section A",
// The sis id of the section. This field is only included if the user has
// permission to view SIS information.
"sis_section_id": "s34643",
// Optional: The integration ID of the section. This field is only included if
// the user has permission to view SIS information.
"integration_id": "3452342345",
// The unique identifier for the SIS import if created through SIS. This field
// is only included if the user has permission to manage SIS information.
"sis_import_id": 47,
// The unique Canvas identifier for the course in which the section belongs
"course_id": 7,
// The unique SIS identifier for the course in which the section belongs. This
// field is only included if the user has permission to view SIS information.
"sis_course_id": "7",
// the start date for the section, if applicable
"start_at": "2012-06-01T00:00:00-06:00",
// the end date for the section, if applicable
"end_at": null,
// Restrict user enrollments to the start and end dates of the section
"restrict_enrollments_to_section_dates": null,
// The unique identifier of the original course of a cross-listed section
"nonxlist_course_id": null,
// optional: the total number of active and invited students in the section
"total_students": 13
}
List course sections SectionsController#index
GET /api/v1/courses/:course_id/sections
url:GET|/api/v1/courses/:course_id/sections
A paginated list of the list of sections for this course.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
include[] | string |
Allowed values: |
|
search_term | string |
When included, searches course sections for the term. Returns only matching results. Term must be at least 2 characters. |
Create course section SectionsController#create
POST /api/v1/courses/:course_id/sections
url:POST|/api/v1/courses/:course_id/sections
Creates a new section for this course.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
course_section[name] | string |
The name of the section |
|
course_section[sis_section_id] | string |
The sis ID of the section. Must have manage_sis permission to set. This is ignored if caller does not have permission to set. |
|
course_section[integration_id] | string |
The integration_id of the section. Must have manage_sis permission to set. This is ignored if caller does not have permission to set. |
|
course_section[start_at] | DateTime |
Section start date in ISO8601 format, e.g. 2011-01-01T01:00Z |
|
course_section[end_at] | DateTime |
Section end date in ISO8601 format. e.g. 2011-01-01T01:00Z |
|
course_section[restrict_enrollments_to_section_dates] | boolean |
Set to true to restrict user enrollments to the start and end dates of the section. |
|
enable_sis_reactivation | boolean |
When true, will first try to re-activate a deleted section with matching sis_section_id if possible. |
Cross-list a Section SectionsController#crosslist
POST /api/v1/sections/:id/crosslist/:new_course_id
url:POST|/api/v1/sections/:id/crosslist/:new_course_id
Move the Section to another course. The new course may be in a different account (department), but must belong to the same root account (institution).
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
override_sis_stickiness | boolean |
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 |
De-cross-list a Section SectionsController#uncrosslist
DELETE /api/v1/sections/:id/crosslist
url:DELETE|/api/v1/sections/:id/crosslist
Undo cross-listing of a Section, returning it to its original course.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
override_sis_stickiness | boolean |
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 |
Edit a section SectionsController#update
PUT /api/v1/sections/:id
url:PUT|/api/v1/sections/:id
Modify an existing section.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
course_section[name] | string |
The name of the section |
|
course_section[sis_section_id] | string |
The sis ID of the section. Must have manage_sis permission to set. |
|
course_section[integration_id] | string |
The integration_id of the section. Must have manage_sis permission to set. |
|
course_section[start_at] | DateTime |
Section start date in ISO8601 format, e.g. 2011-01-01T01:00Z |
|
course_section[end_at] | DateTime |
Section end date in ISO8601 format. e.g. 2011-01-01T01:00Z |
|
course_section[restrict_enrollments_to_section_dates] | boolean |
Set to true to restrict user enrollments to the start and end dates of the section. |
|
override_sis_stickiness | boolean |
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 |
Get section information SectionsController#show
GET /api/v1/courses/:course_id/sections/:id
url:GET|/api/v1/courses/:course_id/sections/:id
GET /api/v1/sections/:id
url:GET|/api/v1/sections/:id
Gets details about a specific section
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
include[] | string |
Allowed values: |
Delete a section SectionsController#destroy
DELETE /api/v1/sections/:id
url:DELETE|/api/v1/sections/:id
Delete an existing section. Returns the former Section.
Returns a Section object