What is a webhook? #
A webhook is a way for an application or service to send real-time notifications or data to another application or service in response to an event occurring on a website or within an application.
Also known as a web callback or HTTP push API, when an event occurs, a webhook will send an HTTP POST request to a URL (a web address) that has been configured for the webhook.
For example, if an application needs to receive notifications when a sale has been made, a payment has been received or a new user signs up, you can set up a webhook that sends a POST request to a URL on your server. Your server can then process the information received in the POST request and take appropriate action, such as adding the new user to your database or sending a confirmation email.
How do webhooks work? #
Webhooks are fairly similar to APIs except that they only deliver data flows one-way, rather than bi-directionally like APIs. However, webhooks can simplify data integration between applications or services by allowing them to communicate in real-time without the need for complex calls or authentication mechanisms.
They can also reduce the amount of requests that an application needs to send to get updates from other services. Instead of repeatedly checking for updates, the application can simply wait for a webhook to be sent.
This helps improve the efficiency of an application by allowing it to act immediately when an event occurs, rather than waiting for the next scheduled request interval.
The steps to integrate webhooks can vary depending on the application or service that is sending the webhook data and the programming language or framework that the application is built on. However, to integrate webhooks, you typically need to follow these general steps:
- Determine the events that you want to trigger the webhook. This could be a new user sign-up, a payment confirmation, or any other event that is important to your application.
- Set up a webhook endpoint in your application to receive the webhook data. This endpoint is typically a URL that your application exposes that can receive the webhook data.
- Provide the URL of your webhook endpoint to the application or service that will be sending the webhook data. This is usually done in the settings or configuration of the application or service.
- Handle the incoming webhook data in your application. This involves parsing the data that is received in the webhook request and taking appropriate actions based on the event that triggered the webhook.
- Send a response to the webhook sender to confirm that the webhook was received and processed successfully. This is usually a simple HTTP response code.
Webhook integration example #
In this webhook integration video we demonstrate how the BPA Platform API can be used with cloud-based applications to trigger further automated processes.
In addition to our other methods to initiate a business process, such as scheduling or database triggers, the BPA Platform API can be used when event based data is shared by applications in the form of webhooks.
In this webhook integration example we will use a WooCommerce webhook, along with the BPA Platform API, to send an order change notification via Email and SMS, whilst updating the changes in an ERP system.
Although this video shows the process between WooCommerce and Sage 200, webhook integrations can be configured for many other business systems.
WooCommerce Webhook Demonstration: #
Welcome to the BPA Platform API demonstration.
In this video, we will demonstrate how the BPA Platform API can be used with cloud-based applications to trigger further business processes.
In addition to our other methods to initiate a business process, such as scheduling or database triggers, the BPA Platform API can be used when event-based data is shared by applications in the form of webhooks.
In this example we will use an eCommerce system webhook, along with the BPA Platform API, to send an order change notification via Email and SMS, whilst updating the changes in an ERP system.
Although this video shows the process between WooCommerce and Sage 200, it can be configured for many other business systems.
Slide Title: Webhook Configuration
In this demonstration, we will be triggering a task from an order change using webhooks, let’s look at the webhook we have created for this purpose.
You can see the status is active, the topic is order updated, and the delivery URL contains the task ID, as seen here in BPA Platform. The secret is populated when you click save. Lastly, we are using the API version 3
Slide Title: IIS
When deploying BPA Platform, a task API website is created within IIS. The configuration file contains the authentication and infrastructure information which is required by BPA Platform.
Slide Title: Payload Variable
Let’s look at the BPA Platform task. In the browser, environment tab, we can see the variables.
The Payload variable is required by BPA Platform to receive the JSON which is sent from the WooCommerce API. The step will transform this data to XML as an output format for the rest of the steps.
For this demonstration, the order change will trigger a formatted email, SMS and in addition, add a memo to sage 200 to notify that order status has changed.
Slide Title: Demonstration
We will begin in the WooCommerce order pane. We can see the top order has a status of Pending Payment. Let’s change the order status to on hold..and If we click update, the task will trigger in BPA Platform.
We can see the task running as triggered by the API.
BPA Platform has created an email notification containing the order ID, timestamp, and the revised status. If we follow the link, it will take us to the relevant order in WooCommerce. The notifications can be assigned to anybody responsible for the order processing.
This information is also replicated in an SMS.
In addition, a memo of the changes, is associated with the account in the ERP system.
Slide Title: Summary
And that’s it for this video we have demonstrated how webhooks can be used by the BPA Platform API to trigger business process automation.