Skip to content

Commit f92f664

Browse files
docs: update signed webhook usage documentation (#440)
1 parent 28491f6 commit f92f664

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

TROUBLESHOOTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
1414
* [Versions](#versions)
1515
* [Environment Variables and Your Twilio SendGrid API Key](#environment)
1616
* [Viewing the Request Body](#request-body)
17+
* [Verifying Event Webhooks](#signed-webhooks)
1718

1819
<a name="migrating"></a>
1920
## Migrating from v2 to v3
@@ -108,3 +109,14 @@ You can do this right before you call `response, err := client.Send(message)` li
108109
```go
109110
fmt.Println(string(mail.GetRequestBody(message)))
110111
```
112+
113+
<a name="signed-webhooks"></a>
114+
## Signed Webhook Verification
115+
116+
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-go library can help you verify these Signed Event Webhooks.
117+
118+
You can find the end-to-end usage example [here](helpers/eventwebhook/README.md) and the tests [here](helpers/eventwebhook/eventwebhook_test.go).
119+
If you are still having trouble getting the validation to work, follow the following instructions:
120+
- Be sure to use the *raw* payload for validation
121+
- Be sure to include a trailing carriage return and newline in your payload
122+
- In case of multi-event webhooks, make sure you include the trailing newline and carriage return after *each* event

0 commit comments

Comments
 (0)