user

Source:
Functions for user endpoints

Namespaces

self

Methods

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

Source:
Author:
  • Gabe Abrams
Get a user's list of courses. Masquerade (act as user) ability is required for this function
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Description
userId number the id of the user to get emails for
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasCourse>>

(async) listEmails(opts, configopt) → {Promise.<Array.<CACCLEmailEntry>>}

Source:
Author:
  • Gabe Abrams
Get a user's list of email addresses. Masquerade (act as user) ability is required for this function
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Attributes Description
userId number the id of the user to get emails for
sortByDate boolean <optional>
if false then sort by ranked order of emails (primary email first), if true then sort by date created so the official emails should be first
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
email address objects
Type
Promise.<Array.<CACCLEmailEntry>>
Source:
Author:
  • Gabe Abrams
Search users
Parameters:
Name Type Attributes Description
opts object object containing all arguments
Properties
Name Type Attributes Default Description
accountId number the account to search through
searchTerm string a search term to apply (must be at least 3 chars). Can be a full ID or partial name. For admins, searches SIS ID, login ID, name, and email address.
isStudent boolean <optional>
if true, only search for students. Only one user type boolean can be true
isTeacher boolean <optional>
if true, only search for teachers. Only one user type boolean can be true
isTA boolean <optional>
if true, only search for TAs. Only one user type boolean can be true
isObserver boolean <optional>
if true, only search for observers. Only one user type boolean can be true
isDesigner boolean <optional>
if true, only search for designers. Only one user type boolean can be true
sortBy string <optional>
username the item to sort by. Can be: "username" or "email" or "sis_id" or "last_login"
sortDescending boolean <optional>
if true, sort descending
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasUser>>