2020-02-14 21:39:12 +01:00
|
|
|
# Get a user
|
|
|
|
|
2020-04-28 20:00:46 +02:00
|
|
|
{generate_api_description(/users/{user_id}:get)}
|
2020-03-27 01:21:21 +01:00
|
|
|
|
2020-02-14 21:39:12 +01:00
|
|
|
## Usage examples
|
|
|
|
|
|
|
|
{start_tabs}
|
|
|
|
{tab|python}
|
|
|
|
|
|
|
|
{generate_code_example(python)|/users/{user_id}:get|example}
|
|
|
|
|
|
|
|
{tab|curl}
|
|
|
|
|
|
|
|
{generate_code_example(curl, include=[""])|/users/{user_id}:get|example}
|
|
|
|
|
|
|
|
You may pass the `client_gravatar` or `include_custom_profile_fields` query parameter as follows:
|
|
|
|
|
|
|
|
{generate_code_example(curl)|/users/{user_id}:get|example}
|
|
|
|
|
|
|
|
{end_tabs}
|
|
|
|
|
|
|
|
## Arguments
|
|
|
|
|
|
|
|
**Note**: The following arguments are all URL query parameters.
|
|
|
|
|
|
|
|
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:get}
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Return values
|
|
|
|
|
2020-03-08 21:13:11 +01:00
|
|
|
* `user`: A dictionary that contains the requested user's details.
|
2020-02-14 21:39:12 +01:00
|
|
|
* `email`: The email address of the user or bot.
|
|
|
|
* `is_bot`: A boolean specifying whether the user is a bot or not.
|
|
|
|
* `avatar_url`: URL to the user's gravatar. `None` if the `client_gravatar`
|
2020-03-28 01:25:56 +01:00
|
|
|
query parameter was set to `True`.
|
2020-02-14 21:39:12 +01:00
|
|
|
* `full_name`: Full name of the user or bot.
|
|
|
|
* `is_admin`: A boolean specifying whether the user is an admin or not.
|
|
|
|
* `bot_type`: `None` if the user isn't a bot. `1` for a `Generic` bot.
|
|
|
|
`2` for an `Incoming webhook` bot. `3` for an `Outgoing webhook` bot.
|
|
|
|
`4` for an `Embedded` bot.
|
|
|
|
* `user_id`: The ID of the user.
|
2020-04-19 00:29:31 +02:00
|
|
|
* `bot_owner_id`: If the user is a bot (i.e. `is_bot` is `True`), `bot_owner_id`
|
|
|
|
is user ID of the user who owns the bot (usually the creator).
|
2020-02-14 21:39:12 +01:00
|
|
|
* `is_active`: A boolean specifying whether the user is active or not.
|
|
|
|
* `is_guest`: A boolean specifying whether the user is a guest user or not.
|
|
|
|
* `timezone`: The time zone of the user.
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
|
|
|
{generate_code_example|/users/{user_id}:get|fixture(200)}
|