Image for post
Image for post

The difference between Webhooks and API calls

Most new web applications these days has an API, which is an excellent way for separate applications to communicate with each other. When you need to ask a question to an application, APIs are great. But what if you want real-time notifications when something changes?

What are webhooks?

In simple terms, webhooks are automated calls from example.com to a server, small code snippets linked to a web application that get triggered when a specific event occurs. They are very useful when you want a web application to notify another web application of an event that has occurred. When a webhook is triggered on the source site, it collects relevant data and sends it to a URL specified by you (called the “listener”) in the form of an HTTP request. An event in one application can be configured to trigger an action in a separate application.

For example, let’s say that you are running a subscription service. If a user fails to make a payment, the automated call may be configured to ask the server to send out a payment reminder email. It would be very inefficient to use API calls to accomplish the same thing, as you would have to make constant requests to check whether payments have been made, rather than just receiving a notification when a payment has not been made.

At SYNQ, we use webhooks to automate various tasks, some examples:

  • Trigger email notifications

The fundamental difference between API calls and webhooks are that API calls provide information based on requests, whereas webhooks provide information based on events.

SYNQ

Your content library and distribution in the cloud with…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store