Objective
Whether you're new to the SendGrid Event Webhook and want to check the data it provides, or you're an experienced user encountering issues receiving data at your designated URL. It's always a good idea to verify the webhook's output using a tool like RequestBin.
SendGrid Event Webhook sends data when a specific email event occurs. The POST request contains a payload of data in JSON format, which includes details about the event. So, to receive and analyse this data, we can use RequestBin. A service that allows us to capture, inspect, and debug HTTP requests sent to a specific URL. RequestBin provides a unique URL that helps to consume HTTP requests, including headers, body, query parameters, and the request method. We recommend using RequestBin for testing purposes, as URLs provided by RequestBin are usually temporary, and the data they collect is stored only for a short period.
Product
Twilio SendGrid - Email API
Procedure
To test or debug issues with your SendGrid webhook callback using Pipedream, follow these steps:
Part 1 : Create a New Project:
- Click on this link here : RequestBin and choose the option to create request Bin
- If you are redirected to Signup page, please a create an account and if you already have an existing account, sign in/login to proceed further.
-
Once logged in, you will be redirected to the below page
-
Now you can click on generate test events and send http request. This will give you a sample data that is posted to the generated URL
- You can then click on 'Back to workflows' in the top-right corner
- You will now be able to see a workflow named “RequestBin” under the “Workflows” section of the dashboard.
-
Click on the Workflow → RequestBin and you will be redirected to the below page where you will be able to see the incoming requests under live events section.
Part 2: Configure the Webhook Trigger in SendGrid:
- Pipedream will generate a unique URL for your webhook. Copy this URL. Refer to step 3 above (From the workflow)
- Now, Login to SendGrid→ Settings→ Mail Settings→ Event Webhook
-
Create a New Webhook and fill the required field. Please refer to the below screenshot
- In the Post URL section, enter the URL generated from Pipedream
Once the above configuration is complete, you can now trigger an email from your account and observe the events logged in the RequestBin workflow you have created. (Refer to Step 7 of Part 1). If you see the event logged in, congratulations, your webhook setup is working as expected.
Additional information:
More details available on event webhook in below linked documents: