2018-01-04 21:35:32 +01:00
|
|
|
# Delete a queue
|
|
|
|
|
|
|
|
Delete a previously registered queue.
|
|
|
|
|
|
|
|
`DELETE {{ api_url }}/v1/events`
|
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{start_tabs}
|
|
|
|
{tab|python}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
2018-06-21 01:28:33 +02:00
|
|
|
{generate_code_example(python)|/events:delete|example}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|js}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
2018-01-14 00:00:08 +01:00
|
|
|
More examples and documentation can be found [here](https://github.com/zulip/zulip-js).
|
2018-09-17 16:27:32 +02:00
|
|
|
|
2018-01-14 00:00:08 +01:00
|
|
|
```js
|
|
|
|
const zulip = require('zulip-js');
|
|
|
|
|
2019-01-07 14:27:58 +01:00
|
|
|
// Pass the path to your zuliprc file here.
|
2018-01-14 00:00:08 +01:00
|
|
|
const config = {
|
2019-01-07 14:27:58 +01:00
|
|
|
zuliprc: 'zuliprc',
|
2018-01-14 00:00:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
zulip(config).then((client) => {
|
|
|
|
// Register a queue
|
|
|
|
const queueParams = {
|
|
|
|
event_types: ['message']
|
|
|
|
};
|
|
|
|
client.queues.register(queueParams).then((res) => {
|
|
|
|
// Delete a queue
|
|
|
|
const deregisterParams = {
|
|
|
|
queue_id: res.queue_id,
|
|
|
|
};
|
|
|
|
client.queues.deregister(deregisterParams).then(console.log);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|curl}
|
|
|
|
|
2019-10-14 12:45:34 +02:00
|
|
|
{generate_code_example(curl)|/events:delete|example}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{end_tabs}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
2018-01-20 22:03:05 +01:00
|
|
|
## Arguments
|
|
|
|
|
2018-06-21 01:28:33 +02:00
|
|
|
{generate_api_arguments_table|zulip.yaml|/events:delete}
|
2018-01-20 22:03:05 +01:00
|
|
|
|
2018-01-04 21:35:32 +01:00
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
2018-06-21 01:28:33 +02:00
|
|
|
{generate_code_example|/events:delete|fixture(200)}
|
2018-01-04 21:35:32 +01:00
|
|
|
|
|
|
|
A typical JSON response for when the `queue_id` is non-existent or the
|
|
|
|
associated queue has already been deleted:
|
|
|
|
|
2018-06-21 01:28:33 +02:00
|
|
|
{generate_code_example|/events:delete|fixture(400)}
|