account

Source:
Functions for interacting with accounts

Methods

(async) get(opts, configopt) → {Promise.<CanvasAccount>}

Source:
Author:
  • Gabe Abrams
Get info on a specific Canvas account
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Description
accountId number Canvas account Id to get info on
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<CanvasAccount>

(async) list(configopt) → {Promise.<Array.<CanvasAccount>>}

Source:
Author:
  • Gabe Abrams
Get the list of accounts in the Canvas instance
Parameters:
Name Type Attributes Description
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasAccount>>

(async) listAdmins(opts, configopt) → {Promise.<Array.<CanvasAdmin>>}

Source:
Author:
  • Gabe Abrams
Gets the list of admins in an account
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Description
accountId number Canvas account Id to get the list of admins from
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasAdmin>>

(async) listCourses(opts, configopt) → {Promise.<Array.<CanvasCourse>>}

Source:
Author:
  • Gabe Abrams
Gets the list of active courses in an account
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Attributes Default Description
accountId number Canvas account Id to get the list of courses from
teacherIds Array.<number> <optional>
all teachers a list of teacher ids to limit the search to
subaccountIds Array.<number> <optional>
all subaccounts a list of subaccount ids to limit the search to
hasEnrollments boolean <optional>
no filter if true, require that the course has at least one enrollment, if false, require that the course has no enrollments
atLeastOneTeacher boolean <optional>
if true, only show courses that have at least one teacher
atLeastOneStudent boolean <optional>
if true, only show courses that have at least one student
atLeastOneTA boolean <optional>
if true, only show courses that have at least one TA
atLeastOneObserver boolean <optional>
if true, only show courses that have at least one observer
atLeastOneDesigner boolean <optional>
if true, only show courses that have at least one designer
published boolean <optional>
no filter if true, only show courses that are published, if false, only show courses that are unpublished
completed boolean <optional>
no filter if true, only show courses that are completed, if false, only show courses that are not completed
blueprint boolean <optional>
no filter if true, only include blueprint courses, if false, only show courses that are not blueprints
blueprintAssociated boolean <optional>
no filter if true, require that the course be associated with a blueprint, if false, require that the course not be associated with a blueprint
state Array.<string> <optional>
no filter a list of states to limit the search to. Allowed values: created, claimed, available, completed, deleted, all
enrollmentTermId number <optional>
no filter an enrollment term to limit the scope of the search to
searchTerm string <optional>
a minimum 3 character string to search the courses by (searches course name, code, or full id)
sortColumn string <optional>
the main data column to sort the results by. Allowed values: course_name, sis_course_id, teacher, account_name
sortOrder string <optional>
the sort order to use: "asc" or "desc"
startsBefore date <optional>
If set, only return courses that start before the value (inclusive) or their enrollment term starts before the value (inclusive) or both the course's start_at and the enrollment term's start_at are set to null. Format can be an ISO 8601 string or a Date instance
endsAfter date <optional>
If set, only return courses that end after the value (inclusive) or their enrollment term ends after the value (inclusive) or both the course's end_at and the enrollment term's end_at are set to null. Format can be an ISO 8601 string or a Date instance
includeSyllabus boolean <optional>
if true, for each course, include its syllabus
includeTerm boolean <optional>
if true, for each course, include its term
includeCourseProgress boolean <optional>
if true, for each course, include its progress
includeStorageQuotaUsedMB boolean <optional>
if true, for each courses, include the number of megabytes of storage used
includeTotalStudents boolean <optional>
if true, for each course, include the total number of students
includeTeachers boolean <optional>
if true, for each course, include the teachers
includeAccountName boolean <optional>
if true, for each course, include its parent account name
includeConcluded boolean <optional>
if true, for each course, include whether the course has been concluded
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasCourse>>