Webhooks API

रीयल-टाइम इवेंट नोटिफिकेशन प्राप्त करें

Webhooks आपको अपने बॉट्स में होने वाली घटनाओं की रीयल-टाइम सूचनाएं प्राप्त करने की अनुमति देते हैं। हमारे API को पोल करने के बजाय, एक webhook URL कॉन्फ़िगर करें और हम तुरंत आपको इवेंट भेजेंगे।

उपलब्ध इवेंट

message.received

चैट में नया संदेश

message.edited

संदेश संपादित किया गया

member.joined

उपयोगकर्ता समूह में शामिल हुआ

member.left

उपयोगकर्ता ने समूह छोड़ा

bot.added

बॉट को समूह में जोड़ा गया

bot.removed

बॉट को समूह से हटाया गया

command.executed

बॉट कमांड निष्पादित किया गया

module.triggered

एक मॉड्यूल एक्शन ट्रिगर हुआ

Endpoints

GET
/api/webhooks

सभी कॉन्फ़िगर किए गए webhooks की सूची देखें

botId
POST
/api/webhooks

नया webhook endpoint बनाएं

urleventssecret
PATCH
/api/webhooks/:id

Webhook कॉन्फ़िगरेशन अपडेट करें

urleventsstatus
DELETE
/api/webhooks/:id

Webhook हटाएं

id
POST
/api/webhooks/:id/test

अपने webhook पर टेस्ट इवेंट भेजें

id

Webhook सुरक्षा

Signature सत्यापन

सभी webhook payloads में सत्यापन के लिए एक signature header शामिल होता है:

X-BotLaunch-Signature: sha256=abc123...

Example Payload

{
  "event": "message.received",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "messageId": "msg_abc123",
    "chatId": "-100123456789",
    "from": {
      "id": 123456789,
      "username": "johndoe"
    },
    "text": "Hello, bot!"
  }
}

Retry नीति

If your endpoint returns a non-2xx status, we'll retry up to 3 times with exponential backoff (10s, 30s, 90s). After 3 failures, the webhook is paused.

और जानें

अपने API इंटीग्रेशन के लिए सुरक्षा सर्वोत्तम प्रथाओं के बारे में जानें।

Security Guide