-
Notifications
You must be signed in to change notification settings - Fork 45
EDU-2092: Adds Generic HTTP webhooks page #2847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
EDU-2092: Adds Generic HTTP webhooks page #2847
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
meta_description: "Configure generic HTTP webhooks to trigger HTTP endpoints and notify external services when events occur in Ably." | ||
meta_keywords: "ably webhooks, http webhooks, webhook integration, generic webhooks, webhook endpoints, event notifications, realtime webhooks" | ||
redirect_from: | ||
- /docs/integrations/webhooks/generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't exist.
index: true, | ||
}, | ||
{ | ||
name: 'Generic HTTP Webhooks', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowercase 'w' please 🙂
2. Click the **Integrations** tab. | ||
3. Click the **New Integration Rule** button. | ||
4. Choose **Webhook**. | ||
5. Choose **Generic HTTP Webhook**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is just 'Webhook' in the dashboard.
| Request Mode | Choose between **Single request** (sends each event individually) or **Batch request** (groups multiple events into a single request). | | ||
| Source | Choose which event types trigger the webhook: `channel.message`, `channel.presence`, `channel.lifecycle`, or `channel.occupancy`. | | ||
| [Channel filter](/docs/platform/integrations/webhooks#filter) | Filters the source channels based on a regular expression. | | ||
| [Enveloped](/docs/platform/integrations/webhooks#enveloped) | When enabled (default), messages are wrapped in additional metadata. When disabled, only the raw message data is sent. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing Sign with key
and Encoding
options here.
## Webhook request format | ||
|
||
There are two webhook request formats: single request and batch request. | ||
|
||
### Single request mode | ||
|
||
When **Single request** mode is selected, a separate HTTP POST request is sent for each event. This is useful when your endpoint processes one event at a time or when you need immediate notification of each event. | ||
|
||
The following example demonstrates request headers: | ||
|
||
``` | ||
POST /webhook HTTP/1.1 | ||
Host: your-endpoint.com | ||
Content-Type: application/json | ||
X-Ably-Message-Id: hKJ7FjEQh@1519124010003-0 | ||
X-Ably-Message-Source: channel.message | ||
X-Ably-Message-Action: message | ||
User-Agent: Ably/1.0 | ||
``` | ||
|
||
The following example is an enveloped payload: | ||
|
||
```json | ||
{ | ||
"source": "channel.message", | ||
"appId": "aBCdEf", | ||
"channel": "channel-name", | ||
"site": "eu-central-1-A", | ||
"ruleId": "1-a2Bc", | ||
"messages": [{ | ||
"id": "ABcDefgHIj:1:0", | ||
"clientId": "user-123", | ||
"connectionId": "ABcDefgHIj", | ||
"timestamp": 1582270137276, | ||
"data": "Hello World", | ||
"name": "greeting" | ||
}] | ||
} | ||
``` | ||
|
||
The following example is a non-enveloped payload: | ||
|
||
``` | ||
Hello World | ||
``` | ||
|
||
### Batch request mode | ||
|
||
When **Batch request** mode is selected, multiple events occurring within a short timeframe are grouped into a single HTTP POST request. This reduces the number of requests and is more efficient for high-throughput scenarios. | ||
|
||
The following example is a batched payload: | ||
```json | ||
{ | ||
"items": [{ | ||
"webhookId": "ABcDEf", | ||
"source": "channel.message", | ||
"serial": "a7bcdEFghAbcDef123456789:4", | ||
"timestamp": 1562124922426, | ||
"name": "channel.message", | ||
"data": { | ||
"channelId": "chat-channel-4", | ||
"site": "eu-west-1-A", | ||
"messages": [{ | ||
"id": "ABcDefgHIj:1:0", | ||
"clientId": "user-3", | ||
"connectionId": "ABcDefgHIj", | ||
"timestamp": 1123145678900, | ||
"data": "the message data", | ||
"name": "a message name" | ||
}] | ||
} | ||
}] | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some things here that don't quite make sense and this info should be covered by the generic section of the webhooks, so maybe drop it?
## Next steps | ||
|
||
For more advanced webhook configuration options and security features, see the [Outbound webhooks overview](/docs/platform/integrations/webhooks). | ||
|
||
You may also want to explore other integration options: | ||
- [Lambda Functions](/docs/platform/integrations/webhooks/lambda) for AWS Lambda integration | ||
- [Azure Functions](/docs/platform/integrations/webhooks/azure) for Microsoft Azure integration | ||
- [Message Queues](/docs/platform/integrations/queues) for reliable message processing | ||
- [Streaming integrations](/docs/platform/integrations/streaming) for data pipeline integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this for any of the other files, and I'm not sure it makes sense to point people to other integrations when they've chosen a specific type.
This PR:
https://ably.atlassian.net/browse/EDU-2071