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â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â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