Update push notification preferences
You can update a user's notifications preferences. A push notification is a message that is immediately delivered to a user's device when the device is either idle or running the client app in the background.
Note: Push notifications are only available for group channels.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Name | Type | Description |
---|---|---|
user_id | string | Specifies the unique ID of a user. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Optional
Property name | Type | Description |
---|---|---|
push_trigger_option | string | The type of notification trigger applies to group channels when a user is disconnected from Sendbird server. Valid values are the following: |
do_not_disturb | boolean | Indicates whether to repeatedly pause notifications for a set period of time on a daily basis. (Default: |
start_hour | int | The start hour for pausing notifications when |
start_min | int | The start minute for pausing notifications when |
end_hour | int | The end hour for pausing notifications when |
end_min | int | The end minute for pausing notifications when |
snooze_enabled | boolean | Indicates whether to snooze notifications for a set period of time. (Default: |
snooze_start_ts | long | The timestamp when snoozing notifications starts in Unix milliseconds. |
snooze_end_ts | long | The timestamp when snoozing notifications ends in Unix milliseconds. |
push_blocked_bot_ids | array of strings | Specifies an array of one or more unique IDs of bots whose notifications a user paused. This property is effective only when |
block_push_from_bots | boolean | Determines whether to block notifications from all bots within the application. If the unique IDs of bots are specified in |
timezone | string | The timezone applied when setting preferences for notifications. Valid values include |
push_sound | string | The name of a sound file played when a notification is delivered to a client app. |
Responses
If successful, this action returns the notifications preferences of a user in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
push_trigger_option | string | The type of notifications trigger applies to group channels when the user is disconnected from Sendbird server. Valid values are the following: |
do_not_disturb | boolean | Indicates whether to repeatedly pause notifications for a set period of time on a daily basis. (Default: |
start_hour | int | The start hour for pausing notifications when |
start_min | int | The start minute for pausing notifications when |
end_hour | int | The end hour for pausing notifications when |
end_min | int | The end minute for pausing notifications when |
snooze_enabled | boolean | Indicates whether to snooze notifications for a set period of time. (Default: |
snooze_start_ts | long | The timestamp when snoozing notifications starts, in Unix milliseconds. |
snooze_end_ts | long | The timestamp when snoozing notifications ends, in Unix milliseconds. |
timezone | string | The timezone applied when setting preferences for notifications. Valid values include |
push_sound | string | The name of the sound file played when a notification is delivered to a client app. |
Error
In the case of an error, an error object like below is returned. See the error codes section for more details.