Skip to content

Commit 49e6895

Browse files
docs: improve signed webhook events docs (#705)
1 parent 470872d commit 49e6895

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

TROUBLESHOOTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
1818
- [Using the Package Manager](#using-the-package-manager)
1919
- [Android Compatibility](#android-compatibility)
2020
- [Viewing the Request Body](#viewing-the-request-body)
21+
- [Verifying Event Webhooks](#signed-webhooks)
2122

2223
<a name="migrating"></a>
2324
## Migrating from v2 to v3
@@ -114,3 +115,15 @@ You can do this right before you call `request.setBody(mail.build())` like so:
114115
```java
115116
System.out.println(mail.build());
116117
```
118+
119+
<a name="signed-webhooks"></a>
120+
## Signed Webhook Verification
121+
122+
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-java library can help you verify these Signed Event Webhooks.
123+
124+
You can find the end-to-end usage example [here](examples/helpers/eventwebhook/Example.java) and the tests [here](/src/test/java/com/sendgrid/helpers/eventwebhook/EventWebhookTest.java).
125+
126+
If you are still having trouble getting the validation to work, follow the following instructions:
127+
- Be sure to use the *raw* payload for validation
128+
- Be sure to include a trailing carriage return and newline in your payload
129+
- In case of multi-event webhooks, make sure you include the trailing newline and carriage return after *each* event

0 commit comments

Comments
 (0)