# Webhooks

Webhooks offer a powerful and efficient method for real-time data exchange and integration between applications. By utilizing webhooks, you can set up an automated communication channel that directly sends specific data from Karabo.ai to your designated URL in response to certain events. This mechanism allows your systems to instantly react, process, or store the information received from Karabo.ai, enhancing the interactivity and dynamism of your services.

# Understanding Webhooks

A webhook is essentially a user-defined HTTP callback (a URL link you provide to us). When certain events occur within the Karabo.ai platform, specifically related to your chatbot, our application will trigger a POST request to the URL specified by you. This request carries with it the data pertinent to the event that initiated the broadcast. You, or your server, can then "listen" to this webhook URL, ready to accept and process the incoming data as it arrives.

# Registering Webhooks on Karabo.ai

  1. Data Collection Chatbot: Whenever a new incident occurs or a client adds a datapoint through the chatbot, we broadcast this data to your webhook URL.
  2. Quote Generation Chatbot: If your chatbot is set up to generate quotes for services or products, each time a quote is generated, the details are sent to your specified webhook URL. This allows for immediate processing and follow-up on potential leads or orders.
  3. Appointment/Calendar Support: For chatbots that assist with scheduling appointments or calendar events, each booking or scheduled event triggers a data broadcast to your webhook. This enables your systems to update scheduling in real-time, reflect changes, and avoid double bookings.

# Advantages of Using Webhooks

  • Zapier: Can connect your webhook to other applications through automation platforms like Zapier. Example: if you have a lead generation chatbot, you can connect the webhook to a CRM via Zapier.
  • Real-Time Updates: Webhooks provide instantaneous information sharing, reducing the need for polling and enabling timely reactions to events.
  • Efficiency: Since webhooks only communicate when an event occurs, they are a bandwidth-efficient method of staying updated.
  • Customization: You control the endpoint and can tailor the processing of incoming data to meet your specific requirements.

# Webhook Endpoints

To keep your applications synchronized with your chatbot's activities, you may need to register a webhook. This registration process involves specifying a URL endpoint that Karabo.ai will use to send POST requests containing relevant data following certain chatbot events.

Endpoint: POST https://karabo.ai/api/v1.0/chatbot-webhook/<str:uniqueId>/

Example request:

{
  "url": "your-webhook-url"
}

Here, "your-webhook-url" should be replaced with the actual URL of the endpoint you've prepared to handle incoming webhook data.

  • Authentication: The request must be authenticated to ensure that only authorized users can register or update webhooks for their chatbots.
  • Chatbot Types: Only chatbots categorized under 'Quote Generation', 'Data Collection', or 'Appointment/Calendar Support' are eligible for webhook registration. This limitation ensures that webhooks are used for chatbots where real-time data broadcasting is most beneficial.

Success response: If updating an existing webhook URL

{
  "chatbot_id": "Existing webhook URL was updated, you can now start listening on the new URL for updates."
}

Success response: If adding a new webhook

{
  "message": "New Webhook has been added, you can now start listening on the URL for updates."
}

# Managing Your Webhooks

After registering your webhook, it's crucial to periodically verify that it is functioning as expected. Ensure that your endpoint remains accessible and capable of processing the incoming data efficiently. In cases where your endpoint URL changes or needs updates, simply repeat the registration process with the new URL to keep the webhook active and updated.

.