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

    Get number of channels by join status

    Copy link

    This action retrieves the number of group channels a user has joined by their join status. You can use various query parameters to determine the search scope of group channels.


    HTTP request

    Copy link
    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/group_channel_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 the group channels with the corresponding types, to retrieve the number of the user's group channels by join status in the filtered channels.

    hidden_mode

    string

    Restricts the search scope to group channels that match a specific hidden_status and operating behavior. Acceptable values are the following:
    - unhidden_only (default): Specifies channels which the user joined with the unhidden status.
    - hidden_only: Specifies all channels which the user joined with either the hidden_allow_auto_unhide or hidden_prevent_auto_unhide status.
    - hidden_allow_auto_unhide: Specifies channels which the user joined with the hidden_allow_auto_unhide status.
    - hidden_prevent_auto_unhide: Specifies channels which the user joined with the hidden_prevent_auto_unhide status.
    - all: Specifies all channels regardless of their hidden_status.

    state

    string

    Determines which join status to use to filter the user's group channels and count the total number. Valid values are the following:
    - joined: Indicates the number count of the user’s joined channels.
    - invited: Indicates the number count of channels which the user has been invited to but not joined.

    super_mode

    string

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


    Responses

    Copy link

    If successful, this action returns the number of the group channels by the user's join status in the response body.

    {
        "group_channel_count": 31
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    group_channel_count

    long

    The number of the user's group channels by join status.

    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
    }