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

    Get a user

    Copy link

    You can retrieve information about a user using this API.


    HTTP request

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

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of the user.

    OptionalTypeDescription

    include_unread_count

    boolean

    Determines whether to include the number of unread messages of the user's group channels in the response. (Default: false)

    custom_types

    string

    Specifies a comma-separated string of one or more custom types. This string can be used to filter the user's group channels and retrieve the number of unread messages only in the filtered channels. This parameter should be specified in conjunction with include_unread_count. Urlencoding each custom type is recommended. An example of a urlencoded string is ?custom_types=urlencoded_type_1,urlencoded_type_2.

    super_mode

    string

    Restricts the search scope to retrieve only Supergroup or non-Supergroup channels. Acceptable values are all, super, and nonsuper. This parameter should be specified in conjunction with include_unread_countabove. (Default: all)

    ?include_unread_count=true&custom_types=art,sports
    

    Responses

    Copy link

    If successful, this action returns a user resource in the response body.

    {
        "user_id": "Tyler",
        "nickname": "SilentSoccer",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_11_512px.png",
        "access_token": "800284474d5d94f3e1658c6c0794872bda4f5f72",
        "is_online": false,
        "is_active": true,
        "created_at": 1581084870,
        "last_seen_at": 1581085696197,
        "discovery_keys": ["987-654-3210", "010-3456-7890"],
        "preferred_languages": ["fr", "de", "es", "ko"],    # French, German, Spanish, and Korean
        "has_ever_logged_in": true,
        "metadata": {
            "font_preference": "times new roman",
            "font_color": "black"
        },
        "unread_channel_count": 7,      # The total number of unread messages in the group channels with the 'art' and 'sports' custom types
        "unread_message_count": 7,      # "unread_channel_count" and "unread_message_count" can only be returned if the `include_unread_count` parameter is set to true in the request.
    }
    

    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
    }