What Are Webhooks

Chatbot essentials | BotSurfer Blogger
Web development has changed in leaps and bounds in recent years. We’ve gone from using the web primarily to share information to much more complex use. We shop online, “swipe right” on dating apps, like content on social media and read reviews. We chat to our friends, to people we want to buy from, and to like minded people in online chat spaces.

Of course, technology has had to evolve along with all those changes in how we use the web, and one of those changes is the advent of the webhook. But what are webhooks, and how could you use them? Read on, as we discuss what are webhooks, where they are used, who uses them, how to create them and more. 

So, What Are Webhooks?

Webhooks are, in the simplest terms, a method of communication that is used by apps. 

More specifically, webhooks are customizable “triggers” that carry a payload based on a particular event. They are sent whenever a user on a website completes a specific interaction or action, and they trigger a response from the receiving website. 

So, for instance, you might create a webhook using the MailChimp API, which is triggered whenever someone signs up to a particular list. Every time that happens, you automatically send them a welcome email, offering them a special deal on a particular product. 

This automated reaction will happen every time someone performs that specific action. But you can create webhooks from any number of APIs, for almost any online action, from making a purchase to checking in, to sending you a message and more. 

Why Use Webhooks?

Now that we know the answer to the question what are webhooks, the next question is probably why you would want to use them. 

The answer is that they automate processes, which makes it easier and more efficient to run your site. 

Let’s imagine you run a membership site. When you are just starting out, every time someone signs up to your site, you have to manually enter the information into Stripe, who is your payment processor. Then you go back to your site and manually approve their account. That’s not very efficient, is it?

In fact, while this kind of manual process might work when your site is small and new, it might make sense to do this manually, but if you are getting dozens or hundreds of new users every month, which becomes harder and a lot more time consuming. 

In fact, if you tried to do this manually with a lot of traffic and conversions, you would spend all your time processing memberships, and still keep your new users waiting – and we know no one wants to wait!

If, however, you were using a membership management software that uses webhooks, you could use the Stripe API to automatically verify and trigger approval of the user. The process would work as follows:

  1. A new user is redirected to Stripe for payment
  2. Stripe captures the username and email and sends it through a webhook using POST
  3. Your software receives this information, and creates a user with that name and email address

Instead of taking half an hour per user, this automated process takes seconds, and many can be run at the same time. So, your new users can login and start using their new account immediately. 

Other Ways to Use Webhooks

Of course, now that we know the answer to the question “what are webhooks,” and a little about how they work as communication and triggers between compatible applications, you might be wondering how you could use them. There are all kinds of possibilities, such as:

  • Keep other applications updated when users change their information on your website – for instance, to automatically update your CRM or autoresponder
  • Connect your email marketing application to your payment processor, to keep users up to date about the status of their payments on your site
  • Send information to third party services
  • Automate customer service on your website with a service like Chatbot

In fact, provided the applications you are connecting are all able to use webhooks, you could automate nearly every frequently completed process on your website and off. Webhooks really are a great way to change the way your site and service work. 

Think of them as the digital equivalent of an IF function in a spreadsheet. If a particular thing happens, they trigger something else to happen. It’s instant and automatic, and you never have to take manual action for that process again. It makes creating user friendly spreadsheets easier, and it makes running your online platform a lot easier too. 

What’s the Difference Between an API and a Webhook?

Webhooks and APIs are often mentioned together, which means it can be confusing when you’re trying to figure out what are webbooks. 

But the answer is relatively simple. 

While webhooks and APIs are both required to perform these kinds of automated tasks it’s worth thinking of an API as a doorway in this case, and the webhook as a messenger that passes through that doorway. 

APIs, also known as application programming interface, allow various programs and software to access the application it is offered by, but it doesn’t do anything on it’s own. Instead, it’s kind of like a multi plug or power bar, which allows you to “plug in” various add ons. Webhooks are one of the types of add ons that can be plugged in via an API. 

APIs can usually perform some functions automatically. But webhooks are better at creating unique, custom actions that happen on your schedule, rather than the APIs. Let’s look at how that happens. 

Different Data Transfer

When you use an API with many other kinds of programming, you rely on a process known as polling for new actions to be triggered. This means that at a predetermined interval, the API will check the server to see if there are any new actions waiting to be performed. 

This process requires your application or program to wait for the API to pull information from the server, which slows things down. Not ideal when you need to perform an action as close to instantly as possible! 

Instead of relying on polling, webhooks push information to the API. Which means you don’t have to wait for them to check their server for new information. You send it directly to the API, on your own schedule. 

So, in this instance, the answer to what are webhooks is a means to speed up the processing of your automated tasks – and in our world of instant gratification, the difference between processing something right now or potentially in an hour’s time is huge.

Can You Create a Webhook for Every Process?

Webhooks sound great, don’t they? In fact, you might be hoping to create webhooks for every process on your website, and then sitting back with your feet up while they get things done. But that’s not always possible.

The problem is that not every application uses webhooks. You need each application that sends and receives a webhook to be able to process them. If one of the links in the chain isn’t there, the process won’t work. 

How to Set Up Webhooks

If all of the applications you are using do use webhooks, you can use them to create custom, automated processes, and it’s quite a simple process:

  1. Get a webhook from the app or program you want to send information to
  2. Use that URL when creating your webhook
  3. Set the event you want to trigger the process, and what you want to happen when it does

Of course, when you are creating custom webhooks, you need to have some programming knowledge. But some applications already have webhooks built in that you can customize using an easier to manage user interface. 

If you aren’t comfortable doing your own programming, you might need to hire a specialist to write this code for you. But it’s a lot quicker, easier, and cheaper to create a new webhook than to program the whole process from scratch! 

How We Use Webhooks

Know that you know the basics about the question of what are webhooks, you might be wondering how we use webhooks to make your customer service easier. 

Botsurfer as one of the best chatbot software uses the Facebook API and webhooks to send information and events from Facebook Messenger to the Chatbot platform. 

That action, based on an automated string from the messenger platform will trigger an action on your site, which might include advanced actions like updating user data, triggering a payment or something else. 

Essentially, it acts as a bridge between the Facebook platform and Chatbot on your website, which allows you to automate actions that are taken on Facebook, rather than on your site. 

This is just another way you can create an integrated experience for your users, make your platform easier and more user friendly to access, and automate processes to take some of the manual labor off your to do list. 

Example of Webhooks Used in Botsurfer

Every information sent from Messenger to our Botsurfer chatbot builder uses the Facebook API and webhooks. If you use any of our elements in the conversation and a user clicks on some of the buttons, there is an API call from Facebook and Botsurfer will use webhooks to catch that action.

If you for example use the main menu of our chatbot and click on the button “What is Botsurfer?” you will trigger API call for webhook:

{

  "object": "page",

  "entry": [

            {

            "id": "101694914514523",

            "time": 1630328373547,

            "messaging": [

            {

            "sender": {

            "id": "2210280919091828"

            },

            "recipient": {

            "id": "101694914514523"

            },

            "timestamp": 1630328373227,

            "postback": {

            "title": "What is Botsurfer?",

            "payload": "m:263"

            }

            }

            ]

            }

  ]

}

 Now when you're more familiar with how chatbots can use webhooks, you might want to have a look at our Botsurfer Facebook chatbot builder to discover why it's loved my freelancers and agencies striving to improve customer experience and engagement for their clients' FB pages.

Business operations
This is Why Your Business Needs a Customer Service Chatbot
Read more
Business operations
How to use banned AI ChatGPT in Italy: Combining Facebook Messenger with Botsurfer
Read more
Business operations
Mastering AI Chatbot Solutions for Messenger: Combining Botsurfer with ChatGPT for Unparalleled Interactions
Read more
Chatbot essentials
Chatbot Names: How to Pick a Good Name for Your Bot
Read more
×
We use cookies to analyze our traffic, provide a better user experience and personalize ads. We also share information about your use of our site with our analytics and advertising partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. You consent to our cookies if you continue to use our website.