2018-06-21 15:23:10 +02:00
|
|
|
# Fetch a development API key
|
|
|
|
|
|
|
|
For easy testing of mobile apps and other clients and against Zulip
|
|
|
|
development servers, we support fetching a Zulip API key for any user
|
|
|
|
on the development server without authentication (so that they can
|
|
|
|
implement analogues of the one-click login process available for Zulip
|
|
|
|
development servers on the web).
|
|
|
|
|
|
|
|
**Note:** This endpoint is only available on Zulip development
|
|
|
|
servers; for obvious security reasons it will always return an error
|
|
|
|
in a Zulip production server.
|
|
|
|
|
|
|
|
`POST {{ api_url }}/v1/dev_fetch_api_key`
|
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
2018-10-18 00:14:30 +02:00
|
|
|
{start_tabs}
|
|
|
|
{tab|curl}
|
2018-06-21 15:23:10 +02:00
|
|
|
|
2019-05-16 22:38:53 +02:00
|
|
|
``` curl
|
|
|
|
curl -X POST {{ api_url }}/v1/dev_fetch_api_key \
|
2018-06-21 15:23:10 +02:00
|
|
|
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
|
|
|
|
-d "username=iago@zulip.com"
|
|
|
|
```
|
|
|
|
|
2018-10-18 00:14:30 +02:00
|
|
|
{end_tabs}
|
2018-06-21 15:23:10 +02:00
|
|
|
|
|
|
|
## Arguments
|
|
|
|
|
|
|
|
{generate_api_arguments_table|zulip.yaml|/dev_fetch_api_key:post}
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Return values
|
|
|
|
|
|
|
|
* `api_key`: The API key that can be used to authenticate as the requested
|
|
|
|
user.
|
|
|
|
* `email`: The email address of the user who owns the API key.
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
|
|
|
{generate_code_example|/dev_fetch_api_key:post|fixture(200)}
|