How to update user notification settings via REST API ?
Users have the ability to update their notification settings to tailor their experience according to their preferences. This article outlines the process for updating these settings, including the required authorizations, request body schema, and possible responses.
Authorization
To execute this action, please ensure that an access token is included in your request header. For details on obtaining the access token, please refer to the relevant documentation here.
Authorization: bearer <token>
Self-Hosted Server
For self-hosted instances, use the following endpoint:
https://{yourdomain}/bi/api/site/<site_identifier>/v5.0/profile/notifications
Bold BI Cloud Server
For Bold BI Cloud instances, the endpoint is:
https://{yourdomain}/bi/api/v5.0/profile/notifications
Request Type
- PUT: This request type is used to update the notification settings for a user.
Example Request
Here is an example of how to structure your PUT request:
Request Body Schema
The request body must include the details of the user notification settings that are to be updated. The following fields are available:
-
InheritMailNotificationSettingsFromGlobalSettings (Optional)
- Type: boolean
- Description: Specify
true
to inherit the global email settings from the system administrator.
-
InheritSystemNotificationSettingsFromGlobalSettings (Optional)
- Type: boolean
- Description: Specify
true
to inherit the global system settings from the system administrator.
-
UserMailNotificationSettings (Required)
- Type: object
- Description: Contains user mail notification details.
-
UserSystemNotificationSettings (Required)
- Type: object
- Description: Contains user system notification details.
Example Request Body
{
"InheritMailNotificationSettingsFromGlobalSettings": true,
"InheritSystemNotificationSettingsFromGlobalSettings": true,
"UserMailNotificationSettings": {
"EnableNotificationForDashboardOwner": true,
"EnableNotificationForAccessibleUser": true,
"EnableNotificationOnUserMention": true,
"EnableNotificationWhenWatchEnabled": true,
"EnableUserScheduleNotification": true,
"EnableUserProfileNotification": true,
"EnableResourceShareNotification": true,
"EnableUserSynchronizationNotification": true
},
"UserSystemNotificationSettings": {
"EnableNotificationForDashboardOwner": true,
"EnableNotificationForAccessibleUser": true,
"EnableNotificationOnUserMention": true,
"EnableNotificationWhenWatchEnabled": true
}
}
Responses
The API will return different responses based on the outcome of the request:
- 200: User notification settings details have been updated successfully.
- 401: Access denied.
- 405: Request type was not PUT.
Additional References
To know more about Bold BI APIs