CommunicationChannel

class canvasapi.communication_channel.CommunicationChannel(requester, attributes)
Parameters:
  • requester (canvasapi.requester.Requester) – The requester to pass HTTP requests through.
  • attributes (dict) – The JSON object to build this object with.
delete(**kwargs)

Delete the current communication_channel

Calls:DELETE /api/v1/users/:user_id/communication_channels/:id
Returns:True if successfully deleted; False otherwise.
Return type:bool
get_preference(notification, **kwargs)

Fetch the preference for the given notification for the given communication channel.

Calls:GET /api/v1/users/:user_id/communication_channels/ :communication_channel_id/notification_preferences/:notification
Parameters:notification (str) – The name of the notification.
Return type:canvasapi.notification_preference.NotificationPreference
get_preference_categories(**kwargs)

Fetch all notification preference categories for the given communication channel.

Calls:GET /api/v1/users/:user_id/communication_channels/ :communication_channel_id/notification_preference_categories
Return type:list
get_preferences(**kwargs)

Fetch all preferences for the given communication channel.

Calls:GET /api/v1/users/:user_id/communication_channels/:communication_channel_id/ notification_preferences
Return type:list
update_multiple_preferences(notification_preferences, **kwargs)

Change preferences for multiple notifications based on the category for a single communication channel.

Calls:PUT /api/v1/users/self/communication_channels/:communication_channel_id/ notification_preferences
Parameters:notification_preferences – Dict that indicates the frequency for different notification types.
Return type:canvasapi.notification_preference.NotificationPreference
update_preference(notification, frequency, **kwargs)

Update the preference for the given notification for the given communication channel.

Calls:

PUT /api/v1/users/self/communication_channels/:communication_channel_id/ notification_preferences/:notification

Parameters:
  • notification (str) – The name of the notification.
  • frequency (str Can be 'immediately', 'daily', 'weekly', or 'never') – The desired frequency for this notification.
Return type:

canvasapi.notification_preference.NotificationPreference

update_preferences_by_catagory(category, frequency, **kwargs)

Change preferences for multiple notifications based on the category for a single communication channel.

Calls:

PUT /api/v1/users/self/communication_channels/:communication_channel_id/ notification_preference_categories/:category

Parameters:
  • category (str) – The name of the category. Must be parameterized e.g. The category Course Content should be course_content
  • frequency (str Can be 'immediately', 'daily', 'weekly', or 'never') – The desired frequency for this notification.
Return type:

canvasapi.notification_preference.NotificationPreference