Get stream ID

Get the unique ID of a given stream.

GET https://zulip.dioco.io/api/v1/get_stream_id

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# 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');

// Pass the path to your zuliprc file here.
const config = { zuliprc: 'zuliprc' };

Zulip(config).then(async (client) => {
    // Get the ID of a given stream
    return await client.streams.getStreamId("Denmark");
}).then(console.log).catch(console.err);

curl -sSX GET -G https://zulip.dioco.io/api/v1/get_stream_id \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \
    -d 'stream=Denmark'

Parameters

Note: The following parameters are all URL query parameters.

stream required

Example: Denmark

The name of the stream to access.


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 JSON response for when the supplied stream does not exist:

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