Account¶
-
class
canvasapi.account.Account(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
-
activate_role(role, **kwargs)¶ Reactivate an inactive role.
Calls: POST /api/v1/accounts/:account_id/roles/:id/activate Parameters: role ( canvasapi.account.Roleor int) – The object or ID of the role.Return type: canvasapi.account.Role
-
add_authentication_providers(**kwargs)¶ Add external authentication providers for the account
Calls: POST /api/v1/accounts/:account_id/authentication_providers Return type: canvasapi.authentication_provider.AuthenticationProvider
-
add_grading_standards(title, grading_scheme_entry, **kwargs)¶ Create a new grading standard for the account.
Calls: Parameters: - title (str) – The title for the Grading Standard
- grading_scheme (list[dict]) – A list of dictionaries containing keys for “name” and “value”
Return type: canvasapi.grading_standards.GradingStandard
-
close_notification_for_user(user, notification)¶ If the user no long wants to see a notification, it can be excused with this call.
Calls: DELETE /api/v1/accounts/:account_id/users/:user_id/account_notifications/:id
Parameters: - user (
canvasapi.user.Useror int) – The user object or ID to close the notificaton for. - notification (
canvasapi.account.AccountNotificationor int) – The notification object or ID to close.
Return type: - user (
-
create_account(**kwargs)¶ Create a new root account.
Calls: POST /api/v1/accounts/:account_id/root_accounts Return type: canvasapi.account.Account
-
create_course(**kwargs)¶ Create a course.
Calls: POST /api/v1/accounts/:account_id/courses Return type: canvasapi.course.Course
-
create_enrollment_term(**kwargs)¶ Create an enrollment term.
Calls: POST /api/v1/accounts/:account_id/terms Return type: canvasapi.enrollment_term.EnrollmentTerm
-
create_external_tool(name, privacy_level, consumer_key, shared_secret, **kwargs)¶ Create an external tool in the current account.
Calls: Parameters: - name (str) – The name of the tool
- privacy_level (str) – What information to send to the external tool. Options are “anonymous”, “name_only”, “public”
- consumer_key (str) – The consumer key for the external tool
- shared_secret (str) – The shared secret with the external tool
Return type:
-
create_group_category(name, **kwargs)¶ Create a Group Category
Calls: POST /api/v1/accounts/:account_id/group_categories Parameters: name (str) – Name of group category. Return type: canvasapi.group.GroupCategory
-
create_notification(account_notification, **kwargs)¶ Create and return a new global notification for an account.
Calls: POST /api/v1/accounts/:account_id/account_notifications Parameters: account_notification (dict) – The notification to create. Return type: canvasapi.account.AccountNotification
-
create_role(label, **kwargs)¶ Create a new course-level or account-level role.
Calls: POST /api/v1/accounts/:account_id/roles Parameters: label (str) – The label for the role. Return type: canvasapi.account.Role
-
create_subaccount(account, **kwargs)¶ Add a new sub-account to a given account.
Calls: POST /api/v1/accounts/:account_id/sub_accounts Parameters: account (str) – The name of the account Return type: canvasapi.account.Account
-
create_user(pseudonym, **kwargs)¶ Create and return a new user and pseudonym for an account.
Calls: POST /api/v1/accounts/:account_id/users Parameters: pseudonym (dict) – The pseudonym of the account. Return type: canvasapi.user.User
-
create_user_login(user, login, **kwargs)¶ Create a new login for an existing user in the given account
Calls: Parameters: - user (dict) – The attributes of the user to create a login for
- login (dict) – The attributes of the login to create
Return type:
-
deactivate_role(role, **kwargs)¶ Deactivate a custom role.
Calls: DELETE /api/v1/accounts/:account_id/roles/:id Parameters: role ( canvasapi.account.Roleor int) – The object or ID of the role.Return type: canvasapi.account.Role
-
delete()¶ Delete the current account
Note: Cannot delete an account with active courses or active sub accounts. Cannot delete a root account.
Calls: DELETE /api/v1/accounts/:account_id/sub_accounts/:id Returns: True if successfully deleted; False otherwise. Return type: bool
-
delete_user(user)¶ Delete a user record from a Canvas root account.
If a user is associated with multiple root accounts (in a multi-tenant instance of Canvas), this action will NOT remove them from the other accounts.
WARNING: This API will allow a user to remove themselves from the account. If they do this, they won’t be able to make API calls or log into Canvas at that account.
Calls: DELETE /api/v1/accounts/:account_id/users/:user_id Parameters: user ( canvasapi.user.Useror int) – The user object or ID to delete.Return type: canvasapi.user.User
-
get_all_outcome_links_in_context()¶ Get all outcome links for context - BETA
Calls: GET /api/v1/accounts/:account_id/outcome_group_links Returns: Paginated List of OutcomesLinks in the context. Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.outcome.OutcomeLink
-
get_authentication_provider(authentication_provider, **kwargs)¶ Get the specified authentication provider
Calls: GET /api/v1/accounts/:account_id/authentication_providers/:id Parameters: authentication_provider ( canvasapi.authentication_provider.AuthenticationProvideror int) – The object or ID of the authentication providerReturn type: canvasapi.authentication_provider.AuthenticationProvider
-
get_courses(**kwargs)¶ Retrieve the list of courses in this account.
Calls: GET /api/v1/accounts/:account_id/courses Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.course.Course
-
get_department_level_grade_data_completed()¶ Return the distribution of all concluded grades in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/completed/grades Return type: dict
-
get_department_level_grade_data_current()¶ Return the distribution of all available grades in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/current/grades Return type: dict
-
get_department_level_grade_data_with_given_term(term_id)¶ Return the distribution of all available or concluded grades with the given term
Calls: GET /api/v1/accounts/:account_id/analytics/terms/:term_id/grades Parameters: term_id (int or str) – The ID of the term, or the strings “current” or “completed” Return type: dict
-
get_department_level_participation_data_completed()¶ Return page view hits all concluded courses in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/completed/activity Return type: dict
-
get_department_level_participation_data_current()¶ Return page view hits all available courses in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/current/activity Return type: dict
-
get_department_level_participation_data_with_given_term(term_id)¶ Return page view hits all available or concluded courses in the given term
Calls: GET /api/v1/accounts/:account_id/analytics/terms/:term_id/activity Parameters: term_id (int or str) – The ID of the term, or the strings “current” or “completed” Return type: dict
-
get_department_level_statistics_completed()¶ Return all available numeric statistics about the department in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/current/statistics Return type: dict
-
get_department_level_statistics_current()¶ Return all available numeric statistics about the department in the default term
Calls: GET /api/v1/accounts/:account_id/analytics/current/statistics Return type: dict
-
get_department_level_statistics_with_given_term(term_id)¶ Return numeric statistics about the department with the given term
Calls: GET /api/v1/accounts/:account_id/analytics/terms/:term_id/statistics Parameters: term_id (int or str) – The ID of the term, or the strings “current” or “completed” Return type: dict
-
get_enrollment(enrollment, **kwargs)¶ Get an enrollment object by ID.
Calls: GET /api/v1/accounts/:account_id/enrollments/:id Parameters: enrollment ( canvasapi.enrollment.Enrollmentor int) – The object or ID of the enrollment to retrieve.Return type: canvasapi.enrollment.Enrollment
-
get_external_tool(tool)¶ Calls: GET /api/v1/accounts/:account_id/external_tools/:external_tool_id Parameters: tool ( canvasapi.external_tool.ExternalToolor int) – The object or ID of the toolReturn type: canvasapi.external_tool.ExternalTool
-
get_external_tools(**kwargs)¶ Calls: GET /api/v1/accounts/:account_id/external_tools Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.external_tool.ExternalTool
-
get_grading_standards(**kwargs)¶ Get a PaginatedList of the grading standards available for the account.
Calls: GET /api/v1/accounts/:account_id/grading_standards Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.grading_standards.GradingStandard
-
get_index_of_reports(report_type)¶ Retrieve all reports that have been run for the account of a specific type.
Calls: GET /api/v1/accounts/:account_id/reports/:report Parameters: report_type (str) – The type of report. Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.account.AccountReport
-
get_outcome_group(group)¶ Returns the details of the Outcome Group with the given id.
Calls: GET /api/v1/accounts/:account_id/outcome_groups/:id Parameters: group ( canvasapi.outcome.OutcomeGroupor int) – The outcome group object or ID to return.Returns: An outcome group object. Return type: canvasapi.outcome.OutcomeGroup
-
get_outcome_groups_in_context()¶ Get all outcome groups for context - BETA
Calls: GET /api/v1/accounts/:account_id/outcome_groups Returns: Paginated List of OutcomesGroups in the context. Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.outcome.OutcomeGroups
-
get_reports()¶ Return a list of reports for the current context.
Calls: GET /api/v1/accounts/:account_id/reports Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.account.AccountReport
-
get_role(role)¶ Retrieve a role by ID.
Calls: GET /api/v1/accounts/:account_id/roles/:id Parameters: role ( canvasapi.account.Roleor int) – The object or ID of the role.Return type: canvasapi.account.Role
-
get_root_outcome_group()¶ Redirect to root outcome group for context
Calls: GET /api/v1/accounts/:account_id/root_outcome_group Returns: The OutcomeGroup of the context. Return type: canvasapi.outcome.OutcomeGroup
-
get_rubric(rubric_id, **kwargs)¶ Get a single rubric, based on rubric id.
Calls: GET /api/v1/accounts/:account_id/rubrics/:id Parameters: rubric_id (int) – The ID of the rubric. Return type: canvasapi.rubric.Rubric
-
get_single_grading_standard(grading_standard_id, **kwargs)¶ Get a single grading standard from the account.
Calls: GET /api/v1/accounts/:account_id/grading_standards/:grading_standard_id Parameters: grading_standard_id (int) – The grading standard id Return type: canvasapi.grading_standards.GradingStandard
-
get_subaccounts(recursive=False)¶ List accounts that are sub-accounts of the given account.
Calls: GET /api/v1/accounts/:account_id/sub_accounts Parameters: recursive (bool) – If true, the entire account tree underneath this account will be returned. If false, only direct sub-accounts of this account will be returned. Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.account.Account
-
get_user_notifications(user)¶ Return a list of all global notifications in the account for this user. Any notifications that have been closed by the user will not be returned.
Calls: GET /api/v1/accounts/:account_id/users/:user_id/account_notifications Parameters: user ( canvasapi.user.Useror int) – The user object or ID to retrieve notifications for.Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.account.AccountNotification
-
get_users(**kwargs)¶ Retrieve a list of users associated with this account.
Calls: GET /api/v1/accounts/:account_id/users Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.user.User
-
list_authentication_providers(**kwargs)¶ Return the list of authentication providers
Calls: GET /api/v1/accounts/:account_id/authentication_providers Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.authentication_provider.AuthenticationProvider
-
list_enrollment_terms(**kwargs)¶ List enrollment terms for a context
Calls: GET /api/v1/accounts/:account_id/terms Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.enrollment_term.EnrollmentTerm
-
list_group_categories()¶ List group categories for a context
Calls: GET /api/v1/accounts/:account_id/group_categories Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.group.GroupCategory
-
list_groups(**kwargs)¶ Return a list of active groups for the specified account.
Calls: GET /api/v1/accounts/:account_id/groups Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.group.Group
-
list_roles(**kwargs)¶ List the roles available to an account.
Calls: GET /api/v1/accounts/:account_id/roles Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.account.Role
-
list_rubrics(**kwargs)¶ Get the paginated list of active rubrics for the current account.
Calls: GET /api/v1/accounts/:account_id/rubrics Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.rubric.Rubric
-
list_user_logins(**kwargs)¶ Given a user ID, return that user’s logins for the given account.
Calls: GET /api/v1/accounts/:account_id/logins Return type: canvasapi.paginated_list.PaginatedListofcanvasapi.login.Login
-
show_account_auth_settings(**kwargs)¶ Return the current state of each account level setting
Calls: GET /api/v1/accounts/:account_id/sso_settings Return type: canvasapi.account.SSOSettings
-
update(**kwargs)¶ Update an existing account.
Calls: PUT /api/v1/accounts/:id Returns: True if the account was updated, False otherwise. Return type: bool
-
update_account_auth_settings(**kwargs)¶ Return the current state of account level after updated
Calls: PUT /api/v1/accounts/:account_id/sso_settings Return type: canvasapi.account.SSOSettings
-
update_role(role, **kwargs)¶ Update permissions for an existing role.
Calls: PUT /api/v1/accounts/:account_id/roles/:id Parameters: role ( canvasapi.account.Roleor int) – The object or ID of the role.Return type: canvasapi.account.Role
- requester (
AccountNotification¶
-
class
canvasapi.account.AccountNotification(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
- requester (
AccountReport¶
-
class
canvasapi.account.AccountReport(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
- requester (
Role¶
-
class
canvasapi.account.Role(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
- requester (
SSOSettings¶
-
class
canvasapi.account.SSOSettings(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
- requester (