Webhooks
Webhooks आपको अपने WhatsApp instances पर events होने पर real-time HTTP callbacks प्राप्त करने की सुविधा देते हैं। API को poll करने के बजाय, Wappfy events को आपके server पर push करता है जैसे ही वे होते हैं।Supported Events
Wappfy 12 webhook event types को support करता है:Message Events
Message Events
Instance Events
Instance Events
Group और Contact Events
Group और Contact Events
एक Webhook बनाएं
Events प्राप्त करना शुरू करने के लिए webhook endpoint register करें।Configuration Options
instance_id field वैकल्पिक है। यदि छोड़ दिया जाए, तो webhook आपके account की सभी instances से events प्राप्त करेगा।Webhooks की सूची
एक Webhook Update करें
किसी मौजूदा webhook का URL, events, या configuration update करें।एक Webhook Delete करें
Delivery Payload Format
जब कोई event होता है, Wappfy आपके webhook URL पर निम्न structure के साथ एक POST request भेजता है:Payload Fields
HMAC Signature Verification
यदि आपने webhook बनाते समयsecret प्रदान किया है, तो प्रत्येक delivery में X-Wappfy-Signature header शामिल होगा जिसमें request body का HMAC-SHA256 signature होगा।
यह सुनिश्चित करने के लिए हमेशा इस signature को verify करें कि request Wappfy से आई है और उसमें छेड़छाड़ नहीं की गई है।
Verification उदाहरण
Retry Behavior
यदि आपका server configuredtimeout_ms के भीतर 2xx status code से respond नहीं करता, तो Wappfy delivery को retry करेगा।
2xx response प्राप्त होने या retry_count समाप्त होने पर retries रुक जाते हैं। Default retry count 3 है।Delivery History देखना
पिछले delivery attempts और उनके results देखने के लिए webhook का delivery log जांचें।Event Payload उदाहरण
message.received
message.received
message.delivered
message.delivered
message.read
message.read
message.reaction
message.reaction
instance.connected
instance.connected
instance.qr
instance.qr
group.joined
group.joined
सर्वोत्तम प्रथाएं
तेजी से respond करें
5 seconds के भीतर
200 status लौटाएं। Timeouts से बचने के लिए event को asynchronously process करें।Deduplicate करें
Retries के कारण duplicate deliveries को detect और skip करने के लिए delivery
id का उपयोग करें।Signatures verify करें
यदि आपने secret configure किया है तो हमेशा
X-Wappfy-Signature header को validate करें।HTTPS उपयोग करें
Webhook URLs को HTTPS उपयोग करना अनिवार्य है। HTTP endpoints reject कर दिए जाएंगे।