Register a queue
Register a queue to receive new messages.
(This endpoint is used internally by the API, and it is
documented here for advanced users that want to customize
how they register for Zulip events. The queue_id
returned
from this endpoint can be used in a subsequent call to the
"events" endpoint.)
POST https://omegaletter.chat/api/v1/register
Usage examples
curl https://omegaletter.chat/api/v1/register \ -u BOT_EMAIL_ADDRESS:BOT_API_KEY -d 'event_types=["message"]'
#!/usr/bin/env python3 import zulip # Download ~/zuliprc-dev from your dev server client = zulip.Client(config_file="~/zuliprc-dev") # Register the queue result = client.register() print(result) # You may pass in one or more of the arguments documented below # as keyword arguments, like so: result = client.register( event_types=['messages'] ) print(result)
More examples and documentation can be found here.
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 params = { event_types: ['message'] }; client.queues.register(params).then(console.log); });
Arguments
Argument | Example | Required | Description |
---|---|---|---|
apply_markdown |
`True` or `False` |
Optional | Set to |
client_gravatar |
`True` or `False` |
Optional | The |
event_types |
event_types=['message'] |
Optional | A JSON-encoded array indicating which types of events you're interested in. Values that you might find useful include: |
all_public_streams |
`True` or `False` |
Optional | Set to |
include_subscribers |
`True` or `False` |
Optional | Set to |
fetch_event_types |
event_types=['message'] |
Optional | Same as the |
narrow |
narrow=['stream', 'Denmark'] |
Optional | A JSON-encoded array of length 2 indicating the narrow for which you'd like to receive events for. For instance, to receive events for the stream |
Response
Return values
queue_id
: The ID of the queue that has been allocated for your client.last_event_id
: The initial value oflast_event_id
to pass toGET /api/v1/events
.
Example response
A typical successful JSON response may look like:
{ "last_event_id": -1, "msg": "", "queue_id": "1517975029:0", "result": "success" }