zulip/templates/zerver/api/get-user-presence.md
Tushar912 55de66f944 api: Support user_id in get_user_presence_endpoint.
This is part of our general process of replacing emails, which are not
static with time, with user_ids when referring to users in the API.

We still keep the `email` reference option, since it can be useful for
linking third-party applications to Zulip on an intranet that might
have a user's corporate email handy and not want to do the extra round
trip to lookup the user.

The name of the parameter, user_id_or_email, was chosen to to make it
clear that the default/preferred option is user_id.

Fixes #14304.
2021-03-11 20:14:04 -08:00

679 B

Get user presence

{generate_api_description(/users/{user_id_or_email}/presence:get)}

Usage examples

{start_tabs} {tab|python}

{generate_code_example(python)|/users/{user_id_or_email}/presence:get|example}

{tab|curl}

{generate_code_example(curl)|/users/{user_id_or_email}/presence:get|example}

{end_tabs}

Parameters

{generate_api_arguments_table|zulip.yaml|/users/{user_id_or_email}/presence:get}

Response

Return values

{generate_return_values_table|zulip.yaml|/users/{user_id_or_email}/presence:get}

Example response

A typical successful JSON response may look like:

{generate_code_example|/users/{user_id_or_email}/presence:get|fixture(200)}