outgoing-webhooks.md: Document example endpoint responses.

This commit is contained in:
Eeshan Garg 2018-09-10 19:46:34 -02:30 committed by Tim Abbott
parent 10570d508f
commit 5c8b774628
1 changed files with 28 additions and 5 deletions

View File

@ -109,15 +109,38 @@ is helpful to distinguish deliberate non-responses from bugs.)
### Example incoming payload ### Example incoming payload
This is an example of the JSON payload that the Zulip server will `POST`
to your server:
{generate_code_example|zulip-outgoing-webhook-payload|fixture} {generate_code_example|zulip-outgoing-webhook-payload|fixture}
### Example response payloads
Here's an example of the JSON your server should respond with if
you would not like to send a response message:
```
{
"response_not_required": true
}
```
Here's an example of the JSON your server should respond with if
you would like to send a response message:
```
{
"content": "Hey, we just received something from Zulip!"
}
```
## Slack-format webhook format ## Slack-format webhook format
This interface translates the Zulip's outgoing webhook's request into This interface translates Zulip's outgoing webhook's request into
Slack's outgoing webhook request. Hence the outgoing webhook bot the format that Slack expects. Hence the outgoing webhook bot
would be able to post data to URLs which support Slack's outgoing would be able to post data to URLs which support Slack-style
webhooks. Here's how we fill in the fields that a Slack format webhook payloads. Here's how we fill in the fields that a
webhook expects: Slack-format webhook expects:
<table class="table"> <table class="table">
<thead> <thead>