Webhooks आपके application को NueForm में कुछ होने पर real-time HTTP notifications receive करने देते हैं। नए responses के लिए API poll करने की बजाय, NueForm form submit होने के moment data आपके server पर push करता है।
Webhooks Pro plan ($29/mo) और उससे ऊपर पर उपलब्ध हैं। Entrepreneur (free) plan users को webhooks उपयोग करने के लिए upgrade करना होगा।
Webhooks कैसे काम करते हैं
जब respondent form submit करता है, NueForm तुरंत आपके configured प्रत्येक webhook URL पर HTTP POST request भेजता है। Request body में event type, form details, और submitted answers के साथ signed JSON payload होता है।
Flow इस प्रकार है:
- Respondent आपका form complete और submit करता है।
- NueForm answers validate करता है और response store करता है।
- NueForm event data युक्त JSON payload construct करता है।
- NueForm HMAC-SHA256 उपयोग करके आपके webhook secret से payload sign करता है।
- NueForm payload को
POSTrequest के रूप में प्रत्येक configured URL पर भेजता है। - आपका server request receive करता है, signature verify करता है, और data process करता है।
Webhook delivery fire-and-forget और non-blocking है। Webhook failures कभी submission flow को affect नहीं करते --- respondents हमेशा successful submission देखते हैं चाहे आपका webhook endpoint reachable हो या नहीं।
Per-Form बनाम Global Webhooks
NueForm दो प्रकार के webhook configuration support करता है:
Per-Form Webhooks
प्रत्येक form का अपना dedicated webhook URL हो सकता है। यह तब उपयोगी है जब आप चाहते हैं कि different forms different systems को notify करें --- उदाहरण के लिए, support form submissions को अपने helpdesk पर और feedback form submissions को अपनी analytics pipeline पर भेजना।
आप per-form webhook URL इनके माध्यम से set कर सकते हैं:
- NueForm Dashboard --- अपने form की settings खोलें और webhook URL enter करें।
- API --- URL programmatically set या update करने के लिए Webhooks API उपयोग करें।
curl -X PUT https://app.nueform.com/api/v1/webhooks/form/FORM_ID \
-H "Authorization: Bearer nf_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "url": "https://your-server.com/webhooks/nueform" }'
Global Webhooks
Global webhooks आपके account में हर form के लिए fire होते हैं। ये centralized logging, analytics, या CRM integrations के लिए उपयोगी हैं जिन्हें सभी submissions process करनी होती हैं चाहे वे किसी भी form से आएं।
आप 5 global webhooks तक configure कर सकते हैं, और प्रत्येक को individually enable या disable किया जा सकता है।
curl -X PUT https://app.nueform.com/api/v1/webhooks/global \
-H "Authorization: Bearer nf_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"webhooks": [
{ "url": "https://analytics.example.com/nueform", "enabled": true },
{ "url": "https://crm.example.com/inbound", "enabled": true },
{ "url": "https://staging.example.com/test", "enabled": false }
]
}'
Delivery Order
जब form submit होता है, NueForm सभी applicable URLs को parallel में webhooks dispatch करता है:
- Form का per-form webhook URL (यदि set है)।
- सभी enabled global webhook URLs।
प्रत्येक target को same payload same signature के साथ receive होता है।
Webhooks कब Fire होते हैं
वर्तमान में, webhooks single event पर fire होते हैं:
| Event | Trigger |
|---|---|
form.submitted | Respondent complete response submit करता है |
Incremental submission enabled forms के लिए, webhook केवल तब fire होता है जब response complete के रूप में mark होता है --- partial saves webhooks trigger नहीं करते।
Full event reference और planned future events के लिए Events देखें।
Webhook Security
प्रत्येक webhook request में X-NueForm-Signature header शामिल होता है जिसमें request body का HMAC-SHA256 hex digest होता है। Webhook data process करने से पहले आपको हमेशा इस signature को verify करना चाहिए ताकि सुनिश्चित हो कि request वास्तव में NueForm से आई है।
आपका webhook secret पहली बार access करने पर स्वचालित रूप से generate होता है और API या dashboard के माध्यम से किसी भी समय regenerate किया जा सकता है।
Implementation details और code samples के लिए Verification देखें।
Delivery Characteristics
| Property | Value |
|---|---|
| HTTP method | POST |
| Content type | application/json |
| Timeout | 5 seconds |
| Retry policy | कोई automatic retries नहीं (fire-and-forget) |
| Signature header | X-NueForm-Signature |
| Signing algorithm | HMAC-SHA256 (hex digest) |
NueForm वर्तमान में 5-second timeout और कोई automatic retries के साथ fire-and-forget delivery model उपयोग करता है। यदि आपका endpoint unreachable है या error return करता है, webhook delivery silently drop हो जाती है। अपने integration को occasional missed deliveries handle करने के लिए design करें --- उदाहरण के लिए, Responses API के माध्यम से periodically reconcile करके।
Quick Start
Webhooks receive करना शुरू करने के लिए:
- अपना webhook secret प्राप्त करें ---
GET /api/v1/webhooks/secretcall करें या अपने dashboard में Developer settings में खोजें। यदि आपके पास अभी तक secret नहीं है तो NueForm auto-generate करता है। - Webhook URL set करें --- Per-form URL configure करें या global webhook add करें।
- अपना endpoint implement करें --- एक HTTP endpoint build करें जो
POSTrequests accept करे, signature verify करे, और payload process करे। - Test करें --- Production में जाने से पहले delivery verify करने के लिए webhook.site या ngrok जैसे tool उपयोग करें। Detailed instructions के लिए Testing Webhooks देखें।
Next Steps
- Events --- Webhook event types के बारे में जानें
- Payloads --- पूर्ण payload schema और examples देखें
- Verification --- HMAC-SHA256 signature verification implement करें
- Testing --- Local development के दौरान webhooks test करें