Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations-docs: Update Hello World for current macros and style.

Lauryn Menardc1d0ffe099b9
diff --git a/templates/zerver/api/incoming-webhooks-walkthrough.md b/templates/zerver/api/incoming-webhooks-walkthrough.md
index bbeba13f71a..dfa18591cf3 100644
--- a/templates/zerver/api/incoming-webhooks-walkthrough.md
+++ b/templates/zerver/api/incoming-webhooks-walkthrough.md
@@ -420,27 +420,29 @@ Second, you need to write the actual documentation content in
```md
Learn how Zulip integrations work with this simple Hello World example!
-The Hello World webhook will use the `test` stream, which is
-created by default in the Zulip dev environment. If you are running
-Zulip in production, you should make sure that this stream exists.
+1. The Hello World webhook will use the `test` stream, which is created
+ by default in the Zulip development environment. If you are running
+ Zulip in production, you should make sure that this stream exists.
-Next, on your {{ settings_html|safe }}, create a Hello World bot.
-Construct the URL for the Hello World bot using the API key and
-stream name:
+1. {!create-bot-construct-url.md!}
-`{{ api_url }}/v1/external/helloworld?api_key=abcdefgh&stream=test`
-To trigger a notification using this webhook, use
-`send_webhook_fixture_message` from the Zulip command line:
+1. To trigger a notification using this example webhook, you can use
+ `send_webhook_fixture_message` from a [Zulip development
+ environment](https://zulip.readthedocs.io/en/latest/development/overview.html):
- (zulip-py3-venv) vagrant@vagrant:/srv/zulip$
- ./manage.py send_webhook_fixture_message \
- --fixture=zerver/tests/fixtures/helloworld/hello.json \
- '--url=http://localhost:9991/api/v1/external/helloworld?api_key=<api_key>'
+ ```
+ (zulip-py3-venv) vagrant@vagrant:/srv/zulip$
+ ./manage.py send_webhook_fixture_message \
+ > --fixture=zerver/tests/fixtures/helloworld/hello.json \
+ > '--url=http://localhost:9991/api/v1/external/helloworld?api_key=abcdefgh&stream=stream%20name;'
+ ```
-Or, use curl:
+ Or, use curl:
- curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key\=<api_key>
+ ```
+ curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key=abcdefgh&stream=stream%20name;
+ ```
{!congrats.md!}
@@ -448,9 +450,10 @@ Or, use curl:
```
-`{!congrats.md!}` is an example of a Markdown macro. Zulip has a macro-based
-Markdown/Jinja2 framework that includes macros for common instructions in
-Zulip's webhooks/integrations documentation.
+`{!create-bot-construct-url.md!}` and `{!congrats.md!}` are examples of
+a Markdown macro. Zulip has a macro-based Markdown/Jinja2 framework that
+includes macros for common instructions in Zulip's webhooks/integrations
+documentation.
See
[our guide on documenting an integration][integration-docs-guide]
diff --git a/zerver/webhooks/helloworld/doc.md b/zerver/webhooks/helloworld/doc.md
index bbaeeec8065..c3c7953456b 100644
--- a/zerver/webhooks/helloworld/doc.md
+++ b/zerver/webhooks/helloworld/doc.md
@@ -3,29 +3,27 @@ Learn how Zulip integrations work with this simple Hello World example!
This webhook is Zulip's official [example
integration](/api/incoming-webhooks-walkthrough).
-1. The Hello World webhook will use the `test` stream, which is
- by default in the Zulip dev environment. If you are running
+1. The Hello World webhook will use the `test` stream, which is created
+ by default in the Zulip development environment. If you are running
Zulip in production, you should make sure that this stream exists.
-1. Next, on your {{ settings_html|safe }}, create a Hello World bot.
- the URL for the Hello World bot using the API key and
- stream name:
+1. {!create-bot-construct-url.md!}
- `{{ api_url }}/v1/external/helloworld?api_key=abcdefgh&stream=test`
-
-1. To trigger a notification using this webhook, you can use
+1. To trigger a notification using this example webhook, you can use
`send_webhook_fixture_message` from a [Zulip development
environment](https://zulip.readthedocs.io/en/latest/development/overview.html):
+ ```
(zulip-py3-venv) vagrant@vagrant:/srv/zulip$
./manage.py send_webhook_fixture_message \
> --fixture=zerver/tests/fixtures/helloworld/hello.json \
- > '--url=http://localhost:9991/api/v1/external/helloworld?api_key=<api_key>'
+ > '--url=http://localhost:9991/api/v1/external/helloworld?api_key=abcdefgh&stream=stream%20name;'
+ ```
Or, use curl:
```
- curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key\=<api_key>
+ curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key=abcdefgh&stream=stream%20name;
```
{!congrats.md!}