Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API
    /
    User

    View push notification preferences for a channel

    You can retrieve a user's notifications preferences for a specific channel. 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. These notifications preferences can be configured.

    Note: Notifications are only available for group channels.

    HTTP request

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

    Parameters

    The following table lists the parameters that this action supports.

    Required
    NameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    channel_url

    string

    Specifies the URL of a group channel.

    Responses

    If successful, this action returns notifications preferences for a channel in the response body.

    {
        "push_trigger_option": "default",   # default
        "push_sound": "bell_ring.swf"
    }
    

    List of response properties

    Property nameTypeDescription

    push_trigger_option

    string

    The type of notification trigger applies to the group channels when the user is disconnected from Sendbird server. Valid values are the following:
    - default (default): Indicates that the user's notification trigger setting applies to the specified channel.
    - all: Indicates that the user receives notification for all new messages.
    - mention_only: Indicates that the user only receives notification for mentioned messages.
    - off: Indicates that a user doesn't receive any notification.

    push_sound

    string

    The name of the sound file to be played when a notification is delivered to the specified channel.

    enable

    boolean

    (Deprecated) Indicates whether notification messages for the user are delivered to the group channel.

    Error

    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
    }