- Source:
Functions for interacting with courses
Namespaces
- analytics
- announcement
- app
- assignment
- assignmentGroup
- discussionTopic
- file
- folder
- gradebookColumn
- group
- groupSet
- module
- navMenuItem
- page
- quiz
- rubric
- section
Methods
(async) get(optsopt, configopt) → {Promise.<CanvasCourse>}
- Source:
- Author:
-
Gets info on a specific course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to get info on |
includeSyllabus |
boolean
|
<optional>
|
|
If truthy, includes
syllabus body |
includeTerm |
boolean
|
<optional>
|
|
If truthy, includes term |
includeAccount |
boolean
|
<optional>
|
|
If truthy, includes account
Id |
includeDescription |
boolean
|
<optional>
|
|
If truthy, includes
public description |
includeSections |
boolean
|
<optional>
|
|
If truthy, includes
sections |
includeTeachers |
boolean
|
<optional>
|
|
If truthy, includes
teachers |
includeCourseImage |
boolean
|
<optional>
|
|
If truthy, includes the
course image |
includeNeedsGradingCount |
boolean
|
<optional>
|
|
If truthy,
includes the number of students who still need to be graded |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasCourse>
(async) getUser(opts, configopt) → {Promise.<CanvasUser>}
- Source:
- Author:
-
Gets info on a specific user in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
userId |
number
|
|
|
Canvas user Id to get |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<CanvasUser>
(async) listDesignerEnrollments(optsopt, configopt) → {Promise.<Array.<CanvasEnrollment>>}
- Source:
- Author:
-
Gets the list of designer enrollments in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeAvatar |
string
|
<optional>
|
|
If truthy, avatar_url is
included |
includeGroups |
string
|
<optional>
|
|
If truthy, group_ids is
included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasEnrollment>>
(async) listDesigners(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of designers in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listEnrollments(optsopt, configopt) → {Promise.<Array.<CanvasEnrollment>>}
- Source:
- Author:
-
Gets the list of enrollments in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
types |
string
|
<optional>
|
all
|
list of enrollment types to include:
['student', 'ta', 'teacher', 'designer', 'observer']
Defaults to all types. |
activeOnly |
boolean
|
<optional>
|
|
If truthy, only active
enrollments included |
includeAvatar |
boolean
|
<optional>
|
|
If truthy, avatar_url is
included |
includeGroups |
boolean
|
<optional>
|
|
If truthy, group_ids is
included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasEnrollment>>
(async) listObserverEnrollments(optsopt, configopt) → {Promise.<Array.<CanvasEnrollment>>}
- Source:
- Author:
-
Gets the list of observer enrollments in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeAvatar |
string
|
<optional>
|
|
If truthy, avatar_url is
included |
includeGroups |
string
|
<optional>
|
|
If truthy, group_ids is
included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasEnrollment>>
(async) listObservers(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of observers in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listStudentEnrollments(optsopt, configopt) → {Promise.<Array.<CanvasEnrollment>>}
- Source:
- Author:
-
Get the list of student enrollments in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeAvatar |
string
|
<optional>
|
|
If truthy, avatar_url is
included |
includeGroups |
string
|
<optional>
|
|
If truthy, group_ids is
included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasEnrollment>>
(async) listStudents(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of students in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listTAs(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of TAs in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listTeachers(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of teachers in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listTeachingTeamMemberEnrollments(optsopt, configopt) → {Promise.<Array.<CanvasEnrollment>>}
- Source:
- Author:
-
Gets the list of TAs and Teacher enrollments in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeAvatar |
string
|
<optional>
|
|
If truthy, avatar_url is
included |
includeGroups |
string
|
<optional>
|
|
If truthy, group_ids is
included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasEnrollment>>
(async) listTeachingTeamMembers(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets the list of TAs and Teachers in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
activeOnly |
string
|
<optional>
|
|
If truthy, only active
enrollments included |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) listUsers(optsopt, configopt) → {Promise.<Array.<CanvasUser>>}
- Source:
- Author:
-
Gets info on all users in a course
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to query |
types |
string
|
<optional>
|
all
|
list of enrollment types to include:
['student', 'ta', 'teacher', 'designer', 'observer']
Defaults to all types. |
includeEmail |
boolean
|
<optional>
|
|
If true, user email is included |
includeEnrollments |
boolean
|
<optional>
|
|
If true, user's enrollments
in this course are included |
includeLocked |
boolean
|
<optional>
|
|
If true, includes whether this
enrollment is locked |
includeAvatar |
boolean
|
<optional>
|
|
If true, user avatar url is
included |
includeBio |
boolean
|
<optional>
|
|
If true, user bio is included |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint
call (overwrites defaults that were included when api was initialized) |
Returns:
-
Type
-
Promise.<Array.<CanvasUser>>
(async) migrateContent(opts, configopt)
- Source:
- Author:
-
Perform a course content migration
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
sourceCourseId |
number
|
<optional>
|
default course id
|
Canvas course Id of
the source course |
destinationCourseId |
number
|
|
|
Canvas course Id of the
destination course |
include |
object
|
|
|
object containing all items and their ids to
include
Properties
| Name |
Type |
Attributes |
Default |
Description |
fileIds |
Array.<number>
|
<optional>
|
[]
|
list of file ids to include |
quizIds |
Array.<number>
|
<optional>
|
[]
|
list of quiz ids to include |
assignmentIds |
Array.<number>
|
<optional>
|
[]
|
list of assignment ids
to include |
assignmentGroupIds |
Array.<number>
|
<optional>
|
[]
|
list of assignment
group ids to include. Without these, Canvas puts every imported
assignment into one "Imported Assignments" group instead of recreating
the groups the assignments came from. Only the assignments listed in
assignmentIds are copied either way: a group that has none of them is
created empty |
announcementIds |
Array.<number>
|
<optional>
|
[]
|
list of announcement
ids to include |
discussionIds |
Array.<number>
|
<optional>
|
[]
|
list of discussion ids
to include |
moduleIds |
Array.<number>
|
<optional>
|
[]
|
list of module ids to
include |
pageIds |
Array.<number>
|
<optional>
|
[]
|
list of page ids to include |
rubricIds |
Array.<number>
|
<optional>
|
[]
|
list of rubric ids to
include |
|
dateShiftOptions |
DateShiftOptions
|
|
|
options for shifting dates |
includeCourseSettings |
boolean
|
<optional>
|
|
if true, also copy the source
course's settings into the destination course |
onProgress |
function
|
<optional>
|
|
called with how far along the
migration is, as a percentage, while waiting for it to finish |
timeoutMs |
number
|
<optional>
|
5 minutes
|
maximum time in milliseconds
to wait for course migration to finish |
|
config |
APIConfig
|
<optional>
|
custom configuration for this specific endpoint |
(async) updatePublishState(optsopt)
- Source:
- Author:
-
Update whether the course is published or not
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
object containing all arguments
Properties
| Name |
Type |
Attributes |
Default |
Description |
courseId |
number
|
<optional>
|
default course id
|
Canvas course Id to
modify |
isPublished |
boolean
|
<optional>
|
|
if true, publish the course. Otherwise,
unpublish the course |
|