Get stream ID

Get the unique ID of a given stream.

GET https://omegaletter.chat/api/v1/get_stream_id

Usage examples

curl https://omegaletter.chat/api/v1/get_stream_id?stream=Denmark \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY
#!/usr/bin/env python3

import zulip

# Download ~/zuliprc-dev from your dev server
client = zulip.Client(config_file="~/zuliprc-dev")

# Get the ID of a given stream
stream_name = 'new stream'
result = client.get_stream_id(stream_name)
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) => {
    // Get the ID of a given stream
    client.streams.getStreamId('Denmark').then(console.log);
});

Arguments

Note: The following arguments are all URL query parameters.

Argument Example Required Description
stream Denmark Required

The name of the stream to retrieve the ID for.

Response

Return values

  • stream_id: The ID of the given stream.

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success",
    "stream_id": 15
}

An example of a JSON response for when the supplied stream does not exist:

{
    "code": "BAD_REQUEST",
    "msg": "Invalid stream name 'nonexistent'",
    "result": "error"
}