All Collections
Other
API
Webhooks: automation as Standard
Webhooks: automation as Standard

Event Hub supports Web-hooks as standard.

Updated over a week ago

In today's modern world of computing, webhooks (or a reverse API) are used as an essential way of sharing data between systems. This is a far more effective, cheaper, scalable, and redundant way to integrate systems when compared to older-style hard coding or data file sharing.

Nearly all new software tools use APIs and webhooks

There are many published articles on the benefits of using webhooks. Here is a short definition found on a Google search;

Webhooks are most commonly used to simplify communication between two applications, but they can also be used to automate Infrastructure-as-code (IaC) workflows and enable GitOps practices.

Advantages include

  1. NO User Interface(UI) = less maintenance, training, and error

  2. 24 X7 real-time Monitoring. Event Hubs SLA assumes webhooks are used.

  3. Real-time incremental data is shared.

  4. The most significant benefit of webhooks is that they allow you to automate workflows within your organization. With webhooks, users can set up triggers to determine which events send data to a different application. Since the data transfer is instantaneous, automation is often seamless and effortless.

Older-style batch processing has many limitations

Older style text export "batch processing" has many flaws. They are "point in time" meaning they are not tested ongoing, They require User Interface(UI) support and therefore skill training and update. Any issues linked to the system are often found not before but at the moment they are needed to work!!

In a world of higher staff rotation - automation of workflows is becoming an essential approach rather than a "nice to have".

Integration with mature systems can be hard

Yes, it's true that older systems will often complicate the consumption of webhooks. Where these systems were built before the time of the internet and cloud computing many were not made with systems that easily integrate new data.

Whilst this is true there are a couple of cheap and easy options to receive webhook data that do NOT involve "full integration" but are still consistent with many of the advantages.

option 1

Google Sheets can be set to receive webhooks and store the data in a Google sheet.

The sheet in fact becomes a webserver. This is an incredibly powerful and free Tool!

The Event Hub team created a Google "webhook receiver" in 4 hours and cost $40 USD.


Here is a copy of the app's script.


Create a sheet called "orders" and "rawpayload" and this code should work. Pls, not that we do not provide support for this code unless you are a licensed EH user.

function doPost(request) {
var jsonData = JSON.parse(request.postData.contents);
var jsonStringData = JSON.stringify (request.postData.contents);
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("orders");
var rawpayloadSheet = ss.getSheetByName("rawpayload");
rawpayloadSheet.appendRow([new Date(), JSON.stringify(request)])
var row = sheet.getLastRow() + 1;

var numRows = jsonData.Items.length;
var values = [];
for (var i = 0; i < numRows; i++) {
var item = jsonData.Items[i];
var rowValues = [
jsonData?.Account,
jsonData?.BillToAccount,
jsonData?.Event,
jsonData?.Function,
jsonData?.OrderStatus,
jsonData?.OrderNumber,
jsonData?.OrganizationCode,
jsonData?.OrderDate,
jsonData?.PriceList,
jsonData?.Space,
item?.OrganizationCode,
item?.StartDate,
item?.EndDate,
item?.PriceList,
item?.PriceListDetailSeqNbr,
item?.ResourceCode,
item?.ItemStatus,
item?.UnitCharge,
item?.Units,
jsonData?.PaymentReceipt,
jsonData?.PaidAmount,
jsonData?.HostName,
jsonData?.MobileNumber,
jsonData?.ArrivalTime,
jsonData?.DietaryRequirements,
jsonData?.GuestNames,
jsonData?.Comments,
jsonData?.Doors,
jsonData?.HostAuth,
jsonData?.UserFirstName,
jsonData?.UserLastName,
jsonData?.UserEmailAddress,
jsonData?.UserMobilePhone
];
values.push(rowValues);
}

var range = sheet.getRange(row, 1, numRows, 33);
range.setValues(values);

var sheet = ss.getSheetByName("rawpayload");
var row = sheet.getLastRow() + 1;
var range = sheet.getRange(row, 1, row, 1);
range.setValues(jsonStringData)
return ContentService.createTextOutput("200 OK")
}

option 2

Sites like this are quite common now

or

or

https://dev.oscato.com/web
As a free HTTP POST Listener

These sites provide receiving URLs and custom actions that can then covert and pass on or store the webhook data.

This site is $15 per month, takes approximately 15 minutes to set up, and requires no developer skills.

Did this answer your question?