docs: Make add-subscriptions use curl example system.

This commit is contained in:
Vishnu Ks
2019-10-10 08:19:51 +00:00
committed by Tim Abbott
parent 94d31e9d4f
commit 06883dc4b2

View File

@@ -52,21 +52,12 @@ zulip(config).then((client) => {
{tab|curl} {tab|curl}
``` curl {generate_code_example(curl, include=["subscriptions"])|/users/me/subscriptions:post|example}
curl -X POST {{ api_url }}/v1/users/me/subscriptions \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
-d 'subscriptions=[{"name": "Verona"}]'
```
To subscribe another user to a stream, you may pass in To subscribe another user to a stream, you may pass in
the `principals` argument, like so: the `principals` argument, like so:
``` curl {generate_code_example(curl, include=["subscriptions", "principals"])|/users/me/subscriptions:post|example}
curl -X POST {{ api_url }}/v1/users/me/subscriptions \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
-d 'subscriptions=[{"name": "Verona"}]' \
-d 'principals=["ZOE@zulip.com"]'
```
{end_tabs} {end_tabs}