mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
api/get-stream-id: Add JavaScript example.
This commit is contained in:
parent
370d2c6bab
commit
b32bb7d5f4
@ -16,6 +16,7 @@ Get the unique ID of a given stream.
|
||||
<ul class="nav">
|
||||
<li data-language="curl">curl</li>
|
||||
<li data-language="python">Python</li>
|
||||
<li data-language="javascript">JavaScript</li>
|
||||
</ul>
|
||||
<div class="blocks">
|
||||
|
||||
@ -42,6 +43,23 @@ print(client.get_stream_id("Denmark"))
|
||||
```
|
||||
</div>
|
||||
|
||||
<div data-language="javascript" markdown="1">
|
||||
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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user