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

    Get number of unread messages

    Copy link

    This action retrieves a user's total number of unread messages in group channels.

    Note: The unread count feature is only available for group channels.


    HTTP request

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

    Parameters

    Copy link

    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

    string

    Specifies a comma-separated string of one or more custom types to filter group channels. URL encoding each type is recommended. If not specified, all channels are returned, regardless of their custom type.

    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)


    Responses

    Copy link

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

    {
        "unread_count": 7
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    unread_count

    long

    The total number of the user's unread messages.

    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
    }