/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Get push notification preferences

    Copy link

    You can retrieves 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

    Copy link
    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/push_preference
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    NameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.


    Responses

    Copy link

    If successful, this action returns the notifications preferences of a user in the response body.

    {
        "push_trigger_option": "all",   # default
        "do_not_disturb": false,        # default
        "start_hour": 0,
        "start_min": 0,
        "end_hour": 0,
        "end_min": 0,
        "snooze_enabled": false,        # default
        "snooze_start_ts": 0,
        "snooze_end_ts": 0,
        "timezone": "UTC",              # default
        "push_sound": "default"
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    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:
    - all (default): Indicates that the user receives notifications for all new messages.
    - mention_only: Indicates that the user only receives notifications for mentioned messages.
    - off: Indicates that the user doesn't receive any notifications.

    do_not_disturb

    boolean

    Indicates whether to repeatedly pause notifications for a set period of time on a daily basis. (Default: false)

    start_hour

    int

    The start hour for pausing notifications when do_not_disturb is set to true.

    start_min

    int

    The start minute for pausing notifications when do_not_disturb is set to true.

    end_hour

    int

    The end hour for pausing notifications when do_not_disturb is set to true.

    end_min

    int

    The end minute for pausing notifications when do_not_disturb is set to true.

    snooze_enabled

    boolean

    Indicates whether to snooze notifications for a set period of time. (Default: false)

    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 UTC, Asia/Seoul, Europe/London, etc. (Default: UTC)

    push_sound

    string

    The name of the sound file played when a notification is delivered to a client app.

    In the case of an error, an error object like below is returned. See the error codes section for more details.

    {
        "message": "\"User\" not found.",
        "code": 400201,
        "error": true
    }