I webhook ti consentono di ricevere notifiche in tempo reale quando si verificano eventi nei tuoi bot. Invece di interrogare la nostra API, configura un URL webhook e ti invieremo gli eventi istantaneamente.
Eventi Disponibili
message.receivedNuovo messaggio in una chat
message.editedMessaggio modificato
member.joinedUtente entrato in un gruppo
member.leftUtente uscito da un gruppo
bot.addedBot aggiunto a un gruppo
bot.removedBot rimosso da un gruppo
command.executedComando bot eseguito
module.triggeredAzione di un modulo attivata
Endpoints
/api/webhooksElenca tutti i webhook configurati
/api/webhooksCrea un nuovo endpoint webhook
/api/webhooks/:idAggiorna la configurazione webhook
/api/webhooks/:idElimina un webhook
/api/webhooks/:id/testInvia un evento di test al tuo webhook
Sicurezza Webhook
Verifica della Firma
Tutti i payload webhook includono un header di firma per la verifica:
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!"
}
}Politica di 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.