mirror of https://github.com/zulip/zulip.git
1.4 KiB
1.4 KiB
Get stream ID
Get the unique ID of a given stream.
GET {{ api_url }}/v1/get_stream_id
Usage examples
- Python
- JavaScript
- curl
curl {{ api_url }}/v1/get_stream_id?stream=Denmark \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY
{generate_code_example(python)|/get_stream_id:get|example}
More examples and documentation can be found [here](https://github.com/zulip/zulip-js).
```js
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); });
</div>
</div>
</div>
## Arguments
**Note**: The following arguments are all URL query parameters.
{generate_api_arguments_table|zulip.yaml|/get_stream_id:get}
## Response
#### Return values
* `stream_id`: The ID of the given stream.
#### Example response
A typical successful JSON response may look like:
{generate_code_example|/get_stream_id:get|fixture(200)}
An example JSON response for when the supplied stream does not exist:
{generate_code_example|/get_stream_id:get|fixture(400)}