Webhook Integration
Webhooks allow you to send form submission data to external services and custom endpoints. This guide explains how to set up and use webhooks with Qivra Form Builder.
What are Webhooks?
Section titled “What are Webhooks?”Webhooks are automated messages sent from one app to another when something happens. With Qivra Form Builder, webhooks send data when:
- A form is submitted
- A specific condition is met
Why Use Webhooks?
Section titled “Why Use Webhooks?”| Use Case | Description |
|---|---|
| Custom Integration | Connect to any service with an API |
| Data Sync | Send submissions to external databases |
| Automation | Trigger workflows in other tools |
| Custom Processing | Process data with your own code |
Setting Up Webhooks
Section titled “Setting Up Webhooks”Step 1: Access Settings
Section titled “Step 1: Access Settings”- Go to Qivra Form Builder
- Click Settings in sidebar
- Go to Integrations > Webhooks
Step 2: Add Webhook
Section titled “Step 2: Add Webhook”- Click Add Webhook
- Enter your endpoint URL
- Select trigger events
- Configure settings
- Click Save
Step 3: Test Webhook
Section titled “Step 3: Test Webhook”- Click Send Test
- Verify receipt at your endpoint
- Check payload format
Webhook Configuration
Section titled “Webhook Configuration”Endpoint URL
Section titled “Endpoint URL”Your endpoint should:
- Accept POST requests
- Be publicly accessible
- Use HTTPS (recommended)
- Return 200 status on success
Trigger Events
Section titled “Trigger Events”| Event | Description |
|---|---|
| Form Submitted | When any form is submitted |
| Specific Form | Only selected forms |
| Conditional | Based on form values |
Secret Key
Section titled “Secret Key”For security, include a secret:
- Enter a secret key
- Verify in your endpoint
- Prevents unauthorized requests
Webhook Payload
Section titled “Webhook Payload”Format
Section titled “Format”Webhooks send JSON data:
{ "event": "form_submitted", "timestamp": "2024-01-15T10:30:00Z", "form": { "id": "abc123", "name": "Contact Form" }, "submission": { "id": "sub456", "data": { "name": "John Doe", "email": "john@example.com", "message": "Hello!" }, "metadata": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0...", "page_url": "https://store.com/contact" } }, "shop": { "id": "shop123", "domain": "store.myshopify.com" }}Data Included
Section titled “Data Included”| Field | Description |
|---|---|
| Event | Type of event |
| Timestamp | When it occurred |
| Form | Form details |
| Submission | All field values |
| Metadata | IP, user agent, URL |
| Shop | Store information |
Per-Form Webhooks
Section titled “Per-Form Webhooks”Form-Specific Endpoints
Section titled “Form-Specific Endpoints”Send different forms to different places:
- Open form in Form Builder
- Go to Settings > Integrations
- Add webhook URL
- Save form
Conditional Webhooks
Section titled “Conditional Webhooks”Send only when conditions met:
IF "Order Value" > 1000THEN trigger webhook to sales teamCommon Integrations
Section titled “Common Integrations”Zapier
Section titled “Zapier”Connect to 5000+ apps:
- Create Zapier webhook trigger
- Copy webhook URL
- Add to Qivra
- Build automation in Zapier
Make (Integromat)
Section titled “Make (Integromat)”Visual automation builder:
- Create scenario with webhook
- Copy webhook URL
- Add to Qivra
- Design workflow
Google Sheets
Section titled “Google Sheets”Log submissions automatically:
- Use Zapier or Make
- Webhook triggers add row
- All submissions logged
Custom API
Section titled “Custom API”Your own application:
- Create endpoint
- Parse JSON payload
- Process as needed
Securing Webhooks
Section titled “Securing Webhooks”Verify Signature
Section titled “Verify Signature”Check requests are from Qivra:
const crypto = require('crypto');
function verifySignature(payload, signature, secret) { const expectedSignature = crypto .createHmac('sha256', secret) .update(JSON.stringify(payload)) .digest('hex');
return signature === expectedSignature;}Best Practices
Section titled “Best Practices”| Practice | Why |
|---|---|
| Use HTTPS | Encrypt data in transit |
| Verify signature | Confirm sender identity |
| Validate data | Check payload structure |
| Rate limit | Prevent abuse |
| Log requests | Debug issues |
Handling Webhooks
Section titled “Handling Webhooks”Response Requirements
Section titled “Response Requirements”Your endpoint should:
| Action | Details |
|---|---|
| Return 200 | Acknowledge receipt |
| Respond quickly | Within 5 seconds |
| Process async | Don’t block response |
Example Endpoint
Section titled “Example Endpoint”Node.js example:
app.post('/webhook/qivra', (req, res) => { // Verify signature const signature = req.headers['x-qivra-signature']; if (!verifySignature(req.body, signature, SECRET)) { return res.status(401).send('Invalid signature'); }
// Acknowledge immediately res.status(200).send('OK');
// Process asynchronously processSubmission(req.body);});Retry Behavior
Section titled “Retry Behavior”Failed Deliveries
Section titled “Failed Deliveries”If webhook fails:
| Attempt | Timing |
|---|---|
| 1st | Immediately |
| 2nd | 1 minute |
| 3rd | 5 minutes |
| 4th | 15 minutes |
| 5th | 1 hour |
Status Codes
Section titled “Status Codes”| Code | Meaning |
|---|---|
| 2xx | Success, don’t retry |
| 4xx | Client error, don’t retry |
| 5xx | Server error, retry |
Debugging Webhooks
Section titled “Debugging Webhooks”Check Delivery
Section titled “Check Delivery”- Go to webhook settings
- View delivery history
- See status and response
Common Issues
Section titled “Common Issues”| Issue | Solution |
|---|---|
| Timeout | Respond faster, process async |
| 404 error | Check URL is correct |
| 401 error | Verify authentication |
| SSL error | Check certificate |
Testing Tools
Section titled “Testing Tools”Use these to test:
- RequestBin - Capture webhooks
- ngrok - Expose local server
- Postman - Send test requests