The Difference Between Webhooks and APIs
The word “webhook” sounds really cool, and it is, but what exactly is it? What does a webhook do and how is it different from an API? What do webhooks have to do with Service Objects’ APIs?
What is an API?
In order to better understand webhooks, let’s first define API, or “application program interface.” APIs are pieces of code developed to execute some sort of logic. They are building blocks used to create other software, which can include creating other APIs. They serve as a common interface between two separate applications, allowing them to interact by sending and receiving data.
APIs can be used internally to support other processes within a company or they can be provided to the public as a paid or unpaid service. Google Maps API, for example, makes it possible to embed a Google map on a webpage. By using the Google Maps API, a web developer has a simple way to include an official Google map pinpointing their business’s exact location. There’s no need for any special coding or reinventing of the proverbial wheel.
Another example would be Service Objects’ address validation API, which makes it possible for our customers to input an address and receive standardized and corrected address information from our USPS CASS Certified database engine.
What is a Webhook?
Webhooks, for the most part, use APIs. Applications that have a mechanism for webhooks will often use a webhook when an event requiring custom logic has been triggered. Events are typically triggered by a workflow or some type of data entry, but other event types exist.
Webhooks give external developers opportunities to implement some sort of custom logic that either executes and returns results or executes custom logic for processes or purposes outside of the given application or both.
Using Marketo marketing automation software and Service Objects’ data validation APIs as an example, when an address is saved or added to a contact in Marketo, a webhook could be used to automatically validate the address using one of our address validation APIs such as our DOTS Address Validation – US 3 API. When the data is available, it is sent to an API call. In this case, there’s no polling from an external application of the host to check back periodically for data to validate.
So, from the standpoint of providing a webhook to a third party such as Service Objects, the intent is to enable that third party to push data back into your Marketo instance or trigger other operations outside of it. In our example, Marketo can send address data to Service Objects and trigger the address validation API thanks to the webhooks that provide this ability. Learn more about Service Objects for Marketo here.
In contrast, from the standpoint providing an API without webhooks, the intent is to enable others to trigger responses from your API to use strictly in their own applications.
There is no purpose to a webhook without an API, but the reverse is not true.
What Does All of This Mean to You?
It means that data validation is easy! Sign up for a free trial and find out just how easy and effective our webhook-powered APIs are.