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

    Get count preference of a channel

    Copy link

    This action retrieves a user's count preference of a specific group channel. The count preference allows a user to either retrieve the number of unread messages or unread mentioned messages, or both in a specific group channel.

    If you want to update the total number count of a specific group channel, visit the update count preference of a channel.


    HTTP request

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

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    channel_url

    string

    Specifies the URL of a group channel.


    Responses

    Copy link

    If successful, this action returns a user's count preference of a group channel in the response body.

    {
        "count_preference": "unread_message_count_only"
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    count_preference

    string

    Indicates whether to only count the number of unread messages or the number of unread mentioned messages in the specified group channel. Only the preferred unread item is counted and added to the total number count. Acceptable values are the following:
    - off: Indicates that neither of unread items are counted.
    - all: Indicates that both unread items are counted.
    - unread_message_count_only: Indicates that only the user's unread messages are counted.
    - unread_mentioned_count_only: Indicates that only the user's unread mentioned messages are counted. (Default: all)

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

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