2024-07-04 13:39:02 +02:00
|
|
|
# Zulip Hello World integration
|
|
|
|
|
2017-06-02 03:58:33 +02:00
|
|
|
Learn how Zulip integrations work with this simple Hello World example!
|
|
|
|
|
2021-03-25 09:40:29 +01:00
|
|
|
This webhook is Zulip's official [example
|
|
|
|
integration](/api/incoming-webhooks-walkthrough).
|
|
|
|
|
2024-07-04 13:39:02 +02:00
|
|
|
{start_tabs}
|
|
|
|
|
2024-05-06 02:25:47 +02:00
|
|
|
1. The Hello World webhook will use the `test` channel, which is created
|
2022-11-28 16:03:59 +01:00
|
|
|
by default in the Zulip development environment. If you are running
|
2024-05-06 02:25:47 +02:00
|
|
|
Zulip in production, you should make sure that this channel exists.
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2023-09-21 02:23:45 +02:00
|
|
|
1. {!create-an-incoming-webhook.md!}
|
|
|
|
|
2024-07-04 13:39:02 +02:00
|
|
|
1. {!generate-webhook-url-basic.md!}
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2023-07-17 19:05:17 +02:00
|
|
|
1. To trigger a notification using this example webhook, you can use
|
2021-03-25 09:40:29 +01:00
|
|
|
`send_webhook_fixture_message` from a [Zulip development
|
|
|
|
environment](https://zulip.readthedocs.io/en/latest/development/overview.html):
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2022-11-28 16:03:59 +01:00
|
|
|
```
|
2022-04-19 03:18:48 +02:00
|
|
|
(zulip-py3-venv) vagrant@vagrant:/srv/zulip$
|
2021-03-15 19:42:26 +01:00
|
|
|
./manage.py send_webhook_fixture_message \
|
|
|
|
> --fixture=zerver/tests/fixtures/helloworld/hello.json \
|
2024-05-06 02:25:47 +02:00
|
|
|
> '--url=http://localhost:9991/api/v1/external/helloworld?api_key=abcdefgh&stream=channel%20name;'
|
2022-11-28 16:03:59 +01:00
|
|
|
```
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2021-03-15 19:42:26 +01:00
|
|
|
Or, use curl:
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2021-03-15 19:42:26 +01:00
|
|
|
```
|
2024-05-06 02:25:47 +02:00
|
|
|
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=channel%20name;
|
2021-03-15 19:42:26 +01:00
|
|
|
```
|
2017-06-02 03:58:33 +02:00
|
|
|
|
2024-07-04 13:39:02 +02:00
|
|
|
{end_tabs}
|
|
|
|
|
2017-06-02 03:58:33 +02:00
|
|
|
{!congrats.md!}
|
|
|
|
|
|
|
|
![](/static/images/integrations/helloworld/001.png)
|
2024-07-04 13:39:02 +02:00
|
|
|
|
|
|
|
### Related documentation
|
|
|
|
|
|
|
|
{!webhooks-url-specification.md!}
|