Skip to content

Commit 0d00f0d

Browse files
docs: improve signed event webhook validation docs (#1013)
1 parent c22b7f6 commit 0d00f0d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
1515
* [Version Convention](#versions)
1616
* [Viewing the Request Body](#request-body)
1717
* [Error Handling](#error-handling)
18+
* [Verifying Event Webhooks](#signed-webhooks)
1819

1920
<a name="environment"></a>
2021
## Environment Variables and Your Twilio SendGrid API Key
@@ -117,3 +118,14 @@ You can do this right before you call `response = sg.client.mail.send.post(reque
117118
# Error Handling
118119

119120
Please review [our use_cases](use_cases/README.md) for examples of error handling.
121+
122+
<a name="signed-webhooks"></a>
123+
## Signed Webhook Verification
124+
125+
Twilio SendGrid's Event Webhook will notify a URL via HTTP POST with information about events that occur as your mail is processed. [This](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features) article covers all you need to know to secure the Event Webhook, allowing you to verify that incoming requests originate from Twilio SendGrid. The sendgrid-python library can help you verify these Signed Event Webhooks.
126+
127+
You can find the usage example [here](examples/helpers/eventwebhook/eventwebhook_example.py) and the tests [here](test/test_eventwebhook.py).
128+
If you are still having trouble getting the validation to work, follow the following instructions:
129+
- Be sure to use the *raw* payload for validation
130+
- Be sure to include a trailing carriage return and newline in your payload
131+
- In case of multi-event webhooks, make sure you include the trailing newline and carriage return after *each* event

0 commit comments

Comments
 (0)