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

    View number of channels with unread messages

    Retrieves the total number of group channels in which a user has unread messages.


    HTTP request

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

    Parameters

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    OptionalTypeDescription

    custom_types[]

    array of strings

    Specifies an array of one or more custom types to filter the group channels with the corresponding types.

    super_mode

    string

    Restricts the search scope to either Supergroup channels or non-Supergroup channels or both. Acceptable values are all, super, and nonsuper. (Default: all)


    Response

    If successful, this action returns the total number of group channels in which the user has unread messages in the response body.

    {
        "unread_count": 4
    }
    

    List of response properties

    Property nameTypeDescription

    unread_count

    long

    The total number of the user's group channels with unread messages.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.