2018-01-05 22:31:56 +01:00
|
|
|
# Get profile
|
|
|
|
|
|
|
|
Get the profile of the user/bot that requests this endpoint.
|
|
|
|
|
|
|
|
`GET {{ api_url }}/v1/users/me`
|
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
|
|
|
<div class="code-section" markdown="1">
|
|
|
|
<ul class="nav">
|
|
|
|
<li data-language="python">Python</li>
|
2018-01-13 23:34:34 +01:00
|
|
|
<li data-language="javascript">JavaScript</li>
|
2018-01-22 22:49:30 +01:00
|
|
|
<li data-language="curl">curl</li>
|
2018-01-05 22:31:56 +01:00
|
|
|
</ul>
|
|
|
|
<div class="blocks">
|
|
|
|
|
|
|
|
<div data-language="curl" markdown="1">
|
|
|
|
|
|
|
|
```
|
|
|
|
curl {{ api_url }}/v1/users/me \
|
|
|
|
-u BOT_EMAIL_ADDRESS:BOT_API_KEY
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div data-language="python" markdown="1">
|
|
|
|
|
2018-01-31 06:06:56 +01:00
|
|
|
{generate_code_example|get-profile|method}
|
2018-01-05 22:31:56 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2018-01-13 23:34:34 +01:00
|
|
|
<div data-language="javascript" markdown="1">
|
|
|
|
More examples and documentation can be found [here](https://github.com/zulip/zulip-js).
|
|
|
|
```js
|
|
|
|
const zulip = require('zulip-js');
|
|
|
|
|
|
|
|
// Download zuliprc-dev from your dev server
|
|
|
|
const config = {
|
|
|
|
zuliprc: 'zuliprc-dev',
|
|
|
|
};
|
|
|
|
|
|
|
|
zulip(config).then((client) => {
|
|
|
|
// Get the profile of the user/bot that requests this endpoint,
|
|
|
|
// which is `client` in this case:
|
|
|
|
client.users.me.getProfile().then(console.log);
|
|
|
|
});
|
|
|
|
```
|
|
|
|
</div>
|
|
|
|
|
2018-01-05 22:31:56 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2018-01-20 22:03:05 +01:00
|
|
|
## Arguments
|
|
|
|
|
|
|
|
This endpoint takes no arguments.
|
|
|
|
|
2018-01-05 22:31:56 +01:00
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Return values
|
|
|
|
|
|
|
|
* `pointer`: The integer ID of the message that the pointer is currently on.
|
|
|
|
* `max_message_id`: The integer ID of the last message by the user/bot with
|
|
|
|
the given profile.
|
|
|
|
|
|
|
|
The rest of the return values are quite self-descriptive.
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
2018-01-31 06:06:56 +01:00
|
|
|
{generate_code_example|get-profile|fixture}
|
2018-01-05 22:31:56 +01:00
|
|
|
|
|
|
|
{!invalid-api-key-json-response.md!}
|