Contact Us

Webhooks are a means for applications and services to establish communication and exchange of information in real-time. Their primary purpose is to enable timely notifications, updates, and data synchronization across various systems or applications.

With webhooks, applications can actively send automated messages, trigger specific actions, leading to seamless integration and coordination across software components, allowing for synchronized workflows. The real-time communication also helps in responsiveness, enabling apps to stay up to date with the latest events in an interconnected digital ecosystem.


How Does a Webhook Work?

  • 1. Event Trigger: The process begins with an event occurring in an application or service. This event can be any action or data change that the application wants to notify other systems about. These may include a new user registration, a completed payment, or an updated record.
  • SPECIFIC BOOKING EVENT TRIGGERS

    booking.scheduled

    booking.rescheduled

    booking.canceled_then_rescheduled

    booking.canceled_reschedule_requested

    booking.canceled

    booking.completed

    booking.no_show

    SPECIFIC CONVERSATION EVENT TRIGGERS

    conversation.started

    conversation.closed

    conversation.abandoned

  • 2. Webhook Registration: The application that wants to receive these notifications provides a URL endpoint, often referred to as a webhook URL or a callback URL. This URL serves as the address to which the notifications are sent.
  • Here is an example defining how the Webhook Registers:

    Imagine you have an application called "App A" that wants to receive notifications from another application called "App B" using webhooks. Here's a simplified visual representation:

    MicrosoftTeams-image (69)

    In the diagram above:

    • 1. "App B" generates an event, such as a new user registration.
    • 2. "App A" provides a webhook endpoint URL, which is typically a route or address within the application. This URL serves as the destination to which the notifications will be sent.
    • 3. When the event occurs, "App B" sends an HTTP POST request to the webhook endpoint URL provided by "App A". The request contains the relevant data about the event.
    • 4. "App A" receives the notification at the webhook endpoint URL and processes the data accordingly.

    The webhook endpoint URL acts as a bridge between the two applications, allowing them to communicate and share information in real-time.


  • 3. Subscription or Configuration: The application generating the events needs to configure or subscribe to the webhook. This is typically done by providing the webhook URL to the service or system that generates the events. The configuration process may involve specifying the types of events the application is interested in or any other relevant parameters.
  • Here is an example defining the aforementioned scenario:

    Imagine you have an application called "App A" that wants to configure or subscribe to webhooks from another application or service called "App B". Here's a step-by-step description:

    • 1. App A initiates the configuration or subscription process with App B, typically through an API or configuration interface.
    • 2. App A provides its webhook URL to App B. This URL is the endpoint where App B will send the notifications.
    • 3. App A may specify the types of events it is interested in, or any other relevant parameters, depending on the capabilities of App B. For example, App A might indicate that it wants to receive notifications for new user registrations, completed transactions, or updates to specific records.
    • 4. App A may also provide authentication credentials, such as API keys or tokens, if required by App B for secure communication and verification.
    • 5. App A submits the configuration or subscription request to App B, along with the provided webhook URL and any additional parameters.
    • 6. App B, then processes the configuration request and verifies the webhook URL provided by App A. This verification step ensures that the URL is valid and reachable.
    • 7. Once the configuration is successful, App B acknowledges the subscription and begins sending notifications to the webhook URL whenever the specified events occur.

  • 4. Event Notification: When the configured event occurs, the application or service generating the event sends an HTTP POST request to the provided webhook URL. The request contains information about the event, often in the form of JSON or XML data. This payload can include details about the event, such as the event type, relevant data, and any additional metadata.
  • Here is an example of a popular event notification service called the "EventNotifier". This service allows applications to subscribe to various events and receive real-time notifications through webhooks.


    Configuration/Subscription

    • Application A wants to receive notifications for new user registrations and completed payments.
    • Application A registers with EventNotifier and provides its webhook URL.
    • Application A specifies the events it's interested in: "user registered" and "payment completed".

    Verification

    • EventNotifier verifies the provided webhook URL by sending a test payload.
    • Application A responds to the verification request, confirming that it received the test payload and providing the necessary verification token.

    Activation and Notification

    • EventNotifier acknowledges the successful verification and activates the webhook subscription for Application A.
    • When a new user registration occurs, EventNotifier sends an HTTP POST request, including details about the event in the payload.
    • Application A receives the notification, processes the event data, and takes appropriate actions, such as updating its user database or triggering further actions.
    • Similarly, when a payment is completed, EventNotifier sends another notification to the webhook URL, allowing Application A to process the payment details accordingly.
    • The specific implementation of webhooks may vary depending on the event notification service and the requirements of the subscribing application. The example above demonstrates how Application A configures and subscribes to events using a webhook URL with EventNotifier and subsequently receives notifications whenever the specified events occur.

      Note: "EventNotifier" is a fictional event notification service created for illustrative purposes. In practice, you would typically utilize the webhooks provided by the specific event notification service you are using.

  • 5. Webhook Processing: The application receiving the webhook notification at the provided URL endpoint performs the necessary actions based on the received data. It can process the information, update its own data or state, trigger additional actions, or send a response back to acknowledge receipt of the webhook.
  • Certainly! Let's consider an example where an e-commerce application, "ShopApp," receives a webhook notification for a new order. Here's how the webhook processing step might look:


    Data Processing

    • ShopApp receives a webhook notification with a payload containing information about the new order, such as order ID, customer details, items purchased, and payment information.
    • ShopApp parses the JSON payload and extracts the relevant data fields, such as order ID, customer name, and item details.

    Updating Data or State

    • ShopApp updates its order management system by adding the new order to its database. It creates a new entry with the order ID, customer details, and item information.
    • ShopApp may also update the inventory by reducing the available quantities of the purchased items.
    • Additionally, ShopApp might update relevant metrics, such as total sales or customer order history.

    Triggering Additional Actions

    • ShopApp may trigger additional actions based on the received order. For example, it might send an order confirmation email to the customer, generate an invoice, or initiate the shipping process.
    • ShopApp could also integrate with other services or systems, such as a payment gateway, to process the payment for the order.

    Sending Response

    • After processing the webhook notification, ShopApp can optionally send a response back to acknowledge the receipt of the webhook. This response could be a simple HTTP status code (e.g., 200 OK) or a more detailed message indicating the processing status.
    • In this example, upon receiving a webhook notification for a new order, ShopApp processes the data by extracting relevant information, updates its own database and state, triggers additional actions like sending emails or processing payments, and optionally sends a response back to acknowledge the receipt of the webhook.

  • 6. Response (optional): After processing the webhook, the receiving application may send a response back to the system that triggered the webhook. This response can serve as an acknowledgment or contain any required information.
  • Certainly! Here's an example of how the receiving application can send a response back to acknowledge the receipt of the webhook:

    • 1. Receiving the Webhook:
      • The application, let's call it "App A," receives a webhook notification at the provided URL endpoint.
    • 2. Webhook Processing:
      • App A processes the received data, performs necessary actions, and updates its internal state accordingly.
    • 3. Sending Response:
      • After processing the webhook, App A can send a response back to acknowledge the receipt of the webhook. This response is typically an HTTP response sent back to the system that triggered the webhook, often referred to as "App B."
      • The response can include a simple acknowledgment, such as an HTTP status code 200 OK, indicating that the webhook was successfully received and processed by App A.
      • Optionally, the response can contain additional information or data required by App B. For example, it might include a specific message, a unique identifier, or any other relevant details that App B needs to track or verify the webhook's processing.

    Here's an example of a response sent by App A to acknowledge the webhook:

    In this example, App A sends an HTTP response with a status code of 200 OK. The response body is in JSON format and contains a message indicating the successful processing of the webhook, along with a webhook ID for reference or tracking purposes.

    The response serves as confirmation to App B that the webhook was received and processed by App A. The content and format of the response can vary based on the specific requirements of the system triggering the webhook and the information App A wants to provide.


Conclusion

As we have seen, webhooks are a flexible and efficient way to enable real-time communication and integration between different systems or services. They allow applications to react to events as they happen, eliminating the need for continuous polling or manual synchronization.

If you are keen to learn more about webhooks are how they’re utilized and leveraged to build applications and systems that communicate seamlessly with each other, then reach out to us. Our team of certified experts will help you understand and implement webhooks to your business’s digital CX and drive tangible growth.

Need Help?