June 4, 2019
It’s not uncommon to use different cloud applications (SaaS applications), for example you may be using a CRM and a mailing tool to manage your online marketing. In many cases you will need to have an integration between both platforms, for example when a new customer is added in your CRM, it should automatically be added to your mailing list. Cloud applications can “talk” to each other using API’s or using webhooks.
Before we talk more about the technical aspects of API’s and webhooks, let’s run through a quick example from real life. Imagine, you are waiting for a home appliance delivery – you can either go outside every minute and check if a delivery van arrived, or you can just wait for a delivery guy to ring your door bell. The first process is time-consuming and inconvenient, meanwhile the second option is just perfect to get real-time updates.
The same applies to integration methods for cloud applications:
One type of integrations uses API calls that perform so-called “polling”. For example, you would use the API to request a list of customers from platform “A” every minute or every hour, and when a new customer is in the response list – trigger a certain action on platform “B”. This process is highly ineffective – it takes a lot of resources on both platforms, and it uses unneeded bandwidth. On top of that, “polling” can introduce unwanted delays.
Another way of integrating two platforms is with the use of webhooks. Webhooks are a way for a cloud application to provide other applications with real-time updates. Webhooks are efficient for both providers and consumers, as they send data to other platforms in real-time as it happens, unlike a typical API integration where you would need to pull data very frequently to deliver data in real-time. So basically instead of continuously asking data and monitoring if something has changed, webhooks will just let you know when a change happened.
A webhook is a mechanism to receive data that originates from some external system, in real time. For example, when a lead fills in a form on a website, you want it to be sent to e.g. your Slack channel immediately. Webhooks are a simple way to get an alert when something happens in another system.
With a webhook you are able to send data as soon as it happens. Webhooks have many benefits, but they are also limited, you cannot use them to synchronise large amounts of data or historical data, you typically cannot use them to work with complex data structures etc.
A webhook is typically configurable by end-users, and it is usually configured by entering a URL (also called an endpoint) and an event. For example, the webhook configured in the CRM, could look like the following:
Event: new customer created
URL to call on event: https://somemailingtool.com/api/incoming_webhook
Once the Webhook in the CRM is set by the end-user, the CRM system will call the configured URL each time a new customer is created. The CRM will add useful information as part of the URL call, and this can be done in different ways.
Blendr.io is a flexible and powerful integration platform with connectors to 200+ cloud applications. The Blend Editor is a visual integration builder where you can create “Blends”, which are integrations between multiple cloud apps. Each Blend that you create, is automatically exposed as a REST API endpoint, which means that it can be called as a webhook URL to execute the Blend (Integration).
Example: you want to configure a webhook in your CRM, to trigger an action in Blendr.io when a new lead is created. This can be accomplished by creating a Blend and calling the Blend via its API endpoint URL.
Example: you want to call a webhook URL from another system, inside a Blend in Blendr.io. This can be accomplished by using a block of type “Call URL” inside your Blend.
In some cases webhooks are not optimal (e.g. for large amounts of data), not desired or simply not supported. Webhooks also do not support “replay”. For example its impossible to use a webhook to push existing leads from your CRM to another system. Webhooks can typically only be used for new data.
Here are some alternatives to consider when a webhook is not possible:
When creating a Blend, use a block of type “List new records incrementally – only once” and schedule your Blend (integration) to run e.g. every 30 seconds or every hour – this will retrieve only new records on each run.
You can also schedule a Blend that retrieves all data, and schedule it to run e.g. once a day. Inside the Blend, you can add logic to check if individual records already exist in the destination platform, and insert or update records accordingly.
Offering a webhook capability is beneficial for both SaaS providers and their customers as it allows to orchestrate certain processes in an efficient manner without unneeded delays, and it optimizes resource usage on involved platforms.