User
- class canvasapi.user.User(requester, attributes)
- Parameters:
requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through.attributes (dict) – The JSON object to build this object with.
- add_observee(observee_id, **kwargs)
Registers a user as being observed by the given user.
- Calls:
- Parameters:
observee_id (int) – The login id for the user to observe.
- Return type:
- add_observee_with_credentials(**kwargs)
Register the given user to observe another user, given the observee’s credentials.
- Calls:
- Return type:
- create_communication_channel(**kwargs)
Create a communication channel for this user
- create_content_migration(migration_type, **kwargs)
Create a content migration.
- Calls:
- Parameters:
migration_type (str or
canvasapi.content_migration.Migrator) – The migrator type to use in this migration- Return type:
- create_folder(name, **kwargs)
Creates a folder in this user.
- Calls:
- Parameters:
name (str) – The name of the folder.
- Return type:
- create_pairing_code(**kwargs)
Create a pairing code for this user.
- Calls:
- Return type:
- edit(**kwargs)
Modify this user’s information.
- Calls:
- Return type:
- export_content(export_type, **kwargs)
Begin a content export job for a user.
- Calls:
- Parameters:
export_type (str) – The type of content to export.
- Return type:
- get_assignments(course, **kwargs)
Return the list of assignments for this user if the current user (the API key owner) has rights to view. See List assignments for valid arguments.
- Calls:
- Parameters:
course (
canvasapi.course.Courseor int) – The object or ID of the course to retrieve.- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.assignment.Assignment
- get_authentication_events(**kwargs)
List authentication events for a given user.
- get_avatars(**kwargs)
Retrieve the possible user avatar options that can be set with the user update endpoint.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.avatar.Avatar
- get_calendar_events_for_user(**kwargs)
List calendar events that the current user can view or manage.
- get_closed_poll_sessions(**kwargs)
Returns a paginated list of all closed poll sessions available to the current user.
- get_color(asset_string, **kwargs)
Return the custom colors that have been saved by this user for a given context.
The asset_string parameter should be in the format ‘context_id’, for example ‘course_42’.
- Calls:
- Parameters:
asset_string (str) – The asset to retrieve the color from.
- Return type:
dict
- get_colors(**kwargs)
Return all custom colors that have been saved by this user.
- Calls:
- Return type:
dict
- get_communication_channels(**kwargs)
List communication channels for the specified user, sorted by position.
- get_content_export(content_export, **kwargs)
Return information about a single content export.
- Calls:
- Parameters:
content_export (int or
canvasapi.content_export.ContentExport) – The object or ID of the content export to show.- Return type:
- get_content_exports(**kwargs)
Return a paginated list of the past and pending content export jobs for a user.
- get_content_migration(content_migration, **kwargs)
Retrive a content migration by its ID
- Calls:
- Parameters:
content_migration (int, str or
canvasapi.content_migration.ContentMigration) – The object or ID of the content migration to retrieve.- Return type:
- get_content_migrations(**kwargs)
List content migrations that the current account can view or manage.
- get_courses(**kwargs)
Retrieve all courses this user is enrolled in.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.course.Course
- get_enabled_features(**kwargs)
Lists all of the enabled features for a user.
- Calls:
- Return type:
list of str
- get_enrollments(**kwargs)
List all of the enrollments for this user.
- get_eportfolios(**kwargs)
Returns a list of ePortfolios for a user.
- get_feature_flag(feature, **kwargs)
Returns the feature flag that applies to the given user.
- Calls:
- Parameters:
feature (
canvasapi.feature.Featureor str) – The feature object or name of the feature to retrieve.- Return type:
- get_features(**kwargs)
Lists all of the features for this user.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.feature.Feature
- get_file(file, **kwargs)
Return the standard attachment json object for a file.
- Calls:
- Parameters:
file (
canvasapi.file.Fileor int) – The object or ID of the file to retrieve.- Return type:
- get_file_quota(**kwargs)
Returns the total and used storage quota for the user.
- Calls:
- Return type:
dict
- get_files(**kwargs)
Returns the paginated list of files for the user.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.file.File
- get_folder(folder, **kwargs)
Returns the details for a user’s folder
- Calls:
- Parameters:
folder (
canvasapi.folder.Folderor int) – The object or ID of the folder to retrieve.- Return type:
- get_folders(**kwargs)
Returns the paginated list of all folders for the given user. This will be returned as a flat list containing all subfolders as well.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.folder.Folder
- get_grade_change_events_for_grader(**kwargs)
Returns the grade change events for a grader.
- get_grade_change_events_for_student(**kwargs)
Returns the grade change events for the current student.
- get_licenses(**kwargs)
Returns a paginated list of the licenses that can be applied to the files under the user scope
- get_migration_systems(**kwargs)
Return a list of migration systems.
- get_missing_submissions(**kwargs)
Retrieve all past-due assignments for which the student does not have a submission.
- get_observees(**kwargs)
List the users that the given user is observing
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.user.User
- get_observers(**kwargs)
List the users that are observing the given user.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.user.User
- get_open_poll_sessions(**kwargs)
Returns a paginated list of all opened poll sessions available to the current user.
- get_page_views(**kwargs)
Retrieve this user’s page views.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.course.PageView
- get_profile(**kwargs)
Retrieve this user’s profile.
- Calls:
- Return type:
dict
- get_user_logins(**kwargs)
Given a user ID, return that user’s logins for the given account.
- Calls:
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.login.Login
- merge_into(destination_user, **kwargs)
Merge this user into another user.
- Calls:
- Parameters:
destination_user (
canvasapi.user.Useror int) – The object or ID of the user to merge into.- Return type:
- moderate_all_eportfolios(**kwargs)
Update the spam_status for all active eportfolios of a user. Only available to admins who can moderate_user_content.
- Parameters:
eportfolio (
canvasapi.eportfolio.EPortfolioor int) – The object or ID of the ePortfolio to retrieve.- Calls:
- Returns:
A list of all user ePortfolios.
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.eportfolio.EPortfolio
- remove_observee(observee_id, **kwargs)
Unregisters a user as being observed by the given user.
- Calls:
- Parameters:
observee_id (int) – The login id for the user to observe.
- Return type:
- remove_usage_rights(**kwargs)
Changes the usage rights for specified files that are under the user scope
- Calls:
- Return type:
dict
- resolve_path(full_path=None, **kwargs)
Returns the paginated list of all of the folders in the given path starting at the user root folder. Returns root folder if called with no arguments.
- Calls:
- Parameters:
full_path (string) – Full path to resolve, relative to user root.
- Return type:
canvasapi.paginated_list.PaginatedListofcanvasapi.folder.Folder
- set_usage_rights(**kwargs)
Changes the usage rights for specified files that are under the user scope
- Calls:
- Return type:
- show_observee(observee_id, **kwargs)
Gets information about an observed user.
- Calls:
- Parameters:
observee_id (int) – The login id for the user to observe.
- Return type:
- terminate_sessions(**kwargs)
Terminate all sessions for a user.
This includes all browser-based sessions and all access tokens, including manually generated ones.
- Calls:
- Return type:
str
- update_color(asset_string, hexcode, **kwargs)
Update a custom color for this user for a given context.
This allows colors for the calendar and elsewhere to be customized on a user basis.
The asset_string parameter should be in the format ‘context_id’, for example ‘course_42’. The hexcode parameter need not include the ‘#’.
- Calls:
- Parameters:
asset_string (str) – The asset to modify the color for.
hexcode (str) – The hexcode of the color to use.
- Return type:
dict
- update_settings(**kwargs)
Update this user’s settings.
- Calls:
- Return type:
dict
- upload(file: PathLike | str | IOBase | FileIO, **kwargs)
Upload a file for a user.
NOTE: You must have authenticated with this user’s API key to upload on their behalf no matter what permissions the issuer of the request has.
- Calls:
- Parameters:
file (file or str) – The file or path of the file to upload.
- Returns:
True if the file uploaded successfully, False otherwise, and the JSON response from the API.
- Return type:
tuple