Albato
  • Language
    En
    English
    Portuguese
    Spanish
  • Welcome to Albato Help

    Creating a seamless integration experience with webhooks


    IN THIS ARTICLE

    Webhooks are a method for applications to communicate in real-time by sending automated messages when specific events occur. Here's how they work:

     

    How webhooks function

    1. Event Triggering: A webhook is initiated by an event in a source application, such as a user action (e.g., submitting a form, making a purchase, or updating a record). When such an event occurs, the application fires a message with relevant data about the event, known as a payload.

    2. Sending Data: The source application sends this payload to a specified webhook URL — a unique endpoint in the receiving application. This URL acts like a phone number that the source application "calls" to deliver information about the event.

    3. HTTP Request: The data is sent over the web using an HTTP request, typically POST. The receiving application processes this request and may respond with an HTTP status code (e.g., 200 OK or 404 Not Found).

    4. Real-Time Updates: Unlike APIs that require polling, webhooks push data instantly when an event occurs — reducing server load and transaction costs.

    5. Subscription Management: Users create webhook subscriptions, specifying which events they want to receive and providing a webhook URL. This often involves an API call.

    Note

    We suggest setting up individual webhooks for each user. Albato will generate a unique webhook URL for each customer and send it to your endpoint. You must store these URLs to reuse them when users run their integrations.

     

    There are two basic types of webhook implementation:

    Auto-subscription (desirable type)

    Here, Albato needs an API method in your SaaS to subscribe to your webhooks. Your subscription API should allow specifying events to subscribe to and accept a subscription URL.

    Example: Shopify webhook subscription

    If using auto-subscription, you must also provide an unsubscribe method.

    Example: Shopify webhook unsubscribe

    Here's how it works step by step:

     
    1. Albato subscribes to your SaaS events.
    2. Albato specifies an HTTPS endpoint to receive events.
    3. Event XYZ in your SaaS is created and a webhook id is returned.
    4. Your SaaS sends a webhook payload to Albato.
    5. Albato unsubscribes using the webhook id when the Automation is stopped.

    Standard webhook requirements:

     
    1. JSON format
    2. Event type in the payload
    3. Payload containing all fields needed in integrations

    See below a Shopify webhook “Customer created” example:

    • Albato subscribes to your webhook

    AD_4nXdKbJBtMYGZCCG6L45J1--5rMOxzQaFXjTxuNuaIC_TNHNyohBMG5ZuDXKo03Er2EQ_keYOx0oK_Xw6rtqTlXhGL2cyCdrrbF3XdHF3AWYyVqdTTW30UNQYMUXd76ZQasUp2pTJpg.jpg

    • Your webhook response with the payload

    AD_4nXdedq1L9UxzhPxfmu6SjbqFKH0pWtKF5SpQ3dhPxJf2-a45gVXTemJREoQum5jtv0MRuKIqgYe0NzMa7zKa7vAA48FDg8iQF3YRUbZ0CXofbA80CAU69xDKo3vXWhL2RWO9PySXrw.jpg

     

    Manual subscription

    If a webhook subscription API isn’t feasible, users can manually paste a webhook URL into your UI using the URL provided by Albato in the iFrame.

    Note

    Manual subscription is not user-friendly as it requires back-and-forth steps for setup.

    You can streamline this via the SSO connection method.

    Example response:

    AD_4nXdp7k56F2s5kBr5opXqR8fTgUW2sXxUYcan_CeIc5SslvHOU7vlApyIGSw2cnjrz_eTGjGdOKsUQFnInaihJZ3MdVyHYrawUV5OJzlU9JbT5NDxCrnbUNiaFY2y3fVLdvGaR7GEuQ.jpg

    Note

    If your webhooks contain custom user-specific fields, Albato can fetch them automatically via your API and insert them into user integrations, improving UX.

    Did this answer your question?