Webhooks Integration
Webhooks allow you to send real-time data from WhautoMail to external applications when specific events occur - no need for manual updates or polling.
โ General Use Casesโ
Below are the available webhook event types:
๐ฅ Contactsโ
- Contact Created: Triggered when a new contact is created
- Contact Tag Added: Triggered when a tag is added to a contact
- Contact Tag Removed: Triggered when a tag is removed from a contact
โ๏ธ How to Setup a Webhookโ
Here are two methods to setup a webhook.
Method 1: Quick Setup โ New Webhookโ
- You can configure up to 5 webhooks; each can listen to multiple selected events
- Only HTTP POST requests are supported
- Payload customization is not available in this method
Steps:โ
- Open the WhautoMail app, go to the Integration menu, and select Webhooks Connect
- Click the New Webhook button
- Fill in the following:
- Webhook Name (e.g., Contact Created)
- Server URL: Where the webhook payload will be sent
- Events to Track: Select one or more events (e.g., Contact Created)
- Click Save to finish the setup
Method 2: Advanced Setup โ Customized Payload via Automationโ
โ This method supports:
- Full payload customization
- Dynamic variables
- Custom headers using RESTful endpoints
Steps:โ
- Go to the Automation menu โ Click Add Rule โ Choose Create Rule from Scratch
- Set the trigger: e.g., When a Contact is created
- (Optional) Click Add Condition to filter the trigger logic
- Choose an Action: Select Send Webhook by WhautoMail
- Fill out the Webhook Configuration:
- Request Method: Select POST
- URL: Enter your webhook receiver endpoint
- Payload: Customize the JSON payload using dynamic variables (#) from WhautoMail
- Headers: Use the default header or click Add Header to include custom headers
- Click Send Test Webhook to test your setup
- Click Save once done
๐งช How to Test Webhooksโ
Testing is critical before going live. Here's how to do it:
Step 1: Create a Test Endpointโ
- Visit https://requestbin.com and sign up
- Click Create Request Bin to generate a test webhook URL
- Copy the generated Request URL
Step 2: Configure in WhautoMailโ
- Paste the Request URL into your Webhook setup in WhautoMail (Step 5 above)
- Trigger the automation (e.g., create a new contact)
Step 3: Verify the Payloadโ
- Return to RequestBin and inspect the incoming test payload
- Verify the data structure and content
- Once verified, click Save in WhautoMail
The Request URL is your endpoint that listens to real-time events from WhautoMail. Use services like RequestBin (Pipedream) for testing, or connect your live system directly.
๐ Webhook Payload Exampleโ
Here's an example of what a webhook payload might look like:
{
"event": "contact.created",
"timestamp": "2024-10-20T14:23:00Z",
"data": {
"contact_id": "12345",
"name": "John Doe",
"email": "johndoe@example.com",
"tags": ["New Lead"],
"status": "subscribed",
"created_at": "2024-10-20T14:23:00Z"
}
}
๐ Security Best Practicesโ
Verify Webhook Sourcesโ
- Implement signature verification to ensure webhooks are from WhautoMail
- Use HTTPS endpoints only
- Validate incoming payload structure
Handle Errors Gracefullyโ
- Return 200 OK status code to acknowledge receipt
- Implement retry logic for failed processing
- Log all webhook events for debugging
Monitor Webhook Performanceโ
- Track webhook delivery success rates
- Set up alerts for failed deliveries
- Monitor response times
๐ง Troubleshootingโ
Webhook Not Triggeringโ
Check Event Configuration
- Verify the correct event is selected
- Ensure the trigger conditions are met
- Check if the automation is enabled
Verify Endpoint URL
- Ensure the URL is accessible
- Check for typos in the URL
- Verify HTTPS is used (if required)
Payload Not Receivedโ
Check Server Logs
- Verify your server is receiving requests
- Check firewall settings
- Ensure port is open
Test with RequestBin
- Use RequestBin to verify WhautoMail is sending data
- Compare payload structure
Authentication Issuesโ
Verify Headers
- Check custom headers are configured correctly
- Ensure authentication tokens are valid
- Verify API keys if required
๐ฌ Need Support?โ
Having trouble configuring or testing webhooks? Contact our support team at support@whautomail.com - we're here to help.