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');
|
|
|
|
|
|
|
|
// Download zuliprc-dev from your dev server
|
|
|
|
const config = {
|
|
|
|
zuliprc: 'zuliprc-dev',
|
|
|
|
};
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
```
|
|
|
|
curl -X "DELETE" {{ api_url }}/v1/events \
|
|
|
|
-u BOT_EMAIL_ADDRESS:BOT_API_KEY
|
|
|
|
-d 'queue_id=1515096410:1'
|
|
|
|
```
|
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)}
|