From b32bb7d5f4a00a5fa5f0e5515b1bbd27bf4ed9eb Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Sat, 13 Jan 2018 18:27:05 -0330 Subject: [PATCH] api/get-stream-id: Add JavaScript example. --- templates/zerver/api/get-stream-id.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/templates/zerver/api/get-stream-id.md b/templates/zerver/api/get-stream-id.md index 0c6af4b997..743dbe6f45 100644 --- a/templates/zerver/api/get-stream-id.md +++ b/templates/zerver/api/get-stream-id.md @@ -16,6 +16,7 @@ Get the unique ID of a given stream.
@@ -42,6 +43,23 @@ print(client.get_stream_id("Denmark")) ```
+
+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); +}); +``` +
+