2018-08-09 20:27:12 +02:00
|
|
|
# Set "typing" status
|
|
|
|
|
2020-04-28 20:00:46 +02:00
|
|
|
{generate_api_description(/typing:post)}
|
2018-08-09 20:27:12 +02:00
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{start_tabs}
|
|
|
|
{tab|python}
|
2018-08-09 20:27:12 +02:00
|
|
|
|
|
|
|
{generate_code_example(python)|/typing:post|example}
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|js}
|
2018-08-09 20:27:12 +02:00
|
|
|
|
|
|
|
More examples and documentation can be found [here](https://github.com/zulip/zulip-js).
|
|
|
|
```js
|
|
|
|
const zulip = require('zulip-js');
|
|
|
|
|
2019-01-07 14:27:58 +01:00
|
|
|
// Pass the path to your zuliprc file here.
|
2018-08-09 20:27:12 +02:00
|
|
|
const config = {
|
2019-01-07 14:27:58 +01:00
|
|
|
zuliprc: 'zuliprc',
|
2018-08-09 20:27:12 +02:00
|
|
|
};
|
|
|
|
|
2020-03-06 19:20:48 +01:00
|
|
|
const user_id1 = 9;
|
|
|
|
const user_id2 = 10;
|
|
|
|
|
2018-08-09 20:27:12 +02:00
|
|
|
const typingParams = {
|
|
|
|
op: 'start',
|
2020-03-06 19:20:48 +01:00
|
|
|
to: [user_id1, user_id2],
|
2018-08-09 20:27:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
zulip(config).then((client) => {
|
|
|
|
// The user has started to type in the group PM with Iago and Polonius
|
|
|
|
return client.typing.send(typingParams);
|
|
|
|
}).then(console.log);
|
|
|
|
```
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|curl}
|
|
|
|
|
2019-10-11 15:00:43 +02:00
|
|
|
{generate_code_example(curl)|/typing:post|example}
|
2018-08-09 20:27:12 +02:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{end_tabs}
|
2018-08-09 20:27:12 +02:00
|
|
|
|
|
|
|
## Arguments
|
|
|
|
|
|
|
|
{generate_api_arguments_table|zulip.yaml|/typing:post}
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
|
|
|
{generate_code_example|/typing:post|fixture(200)}
|