From b9549250f37548443dd95c6ebade1e90bf704f1e Mon Sep 17 00:00:00 2001 From: Adam Birds Date: Mon, 15 Mar 2021 18:42:26 +0000 Subject: [PATCH] integrations: Update Hello World Docs. I have the updated the documentation page for the hello world integration to include numbers to bring it up to standard and make it more readable. Fixes part of #17633. --- zerver/webhooks/helloworld/doc.md | 39 ++++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/zerver/webhooks/helloworld/doc.md b/zerver/webhooks/helloworld/doc.md index f795a9ef46..6cd96e09a1 100644 --- a/zerver/webhooks/helloworld/doc.md +++ b/zerver/webhooks/helloworld/doc.md @@ -1,33 +1,28 @@ 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 + by default in the Zulip dev 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. 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: -`{{ api_url }}/v1/external/helloworld?api_key=abcdefgh&stream=test` + `{{ api_url }}/v1/external/helloworld?api_key=abcdefgh&stream=test` +1. To trigger a notification using this webhook, use + `send_webhook_fixture_message` from the Zulip command line: -To trigger a notification using this webhook, use -`send_webhook_fixture_message` from the Zulip command line: + (zulip-py3-venv) vagrant@ubuntu-bionic:/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@ubuntu-bionic:/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>' + 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\=<api_key> + ``` {!congrats.md!}