What is a webhook?

When writing code that integrates different services, it’s common to use webhooks.

What is a webhook?

A webhook is a POST request handler that listens for somebody to call it, and when this happens it performs some kind of work.

Let…


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

When writing code that integrates different services, it’s common to use webhooks.

What is a webhook?

A webhook is a POST request handler that listens for somebody to call it, and when this happens it performs some kind of work.

Let me do an example. I use Paddle to sell my Bootcamp and any time anyone signs up, my webhook is called with some JSON data.

The data includes the customer email, the customer name, the product bought.

The webhook is then responsible to add the customer to an Airtable base, and to email the customer to welcome and send them some information.

In my specific case, the webhook is a Node.js app built using Express, but it could be anything that can accept network requests, and is accessible from the Internet. I put it on a VPS, but it could also be a serverless function.

It’s common for any payment platform to offer webhooks - they process the payment, then they let you do “things” that you might need to do.

Another use case for a webhook is running tasks on a machine when you want it. For example all deployment platforms offer a webhook that you can call to trigger a new deploy.

I use that on Netlify or Cloudflare Pages. I have a IFTTT task that every day at 8AM triggers the deploy procedure, so the post that I scheduled the day before is published, as its published date is now passed.

This is key to my consistency, since I know every day at 8AM the post of my static site is going to be published. I no longer need to do it manually.

Many no-code tools allow you to use them to create automations.

They’re pretty cool.

If you think about it, webhooks are the glue that keeps the Internet together. They definitely allow me to run my business, so I’m grateful for them to exist.


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com


Print Share Comment Cite Upload Translate Updates
APA

flaviocopes.com | Sciencx (2021-11-28T05:00:00+00:00) What is a webhook?. Retrieved from https://www.scien.cx/2021/11/28/what-is-a-webhook/

MLA
" » What is a webhook?." flaviocopes.com | Sciencx - Sunday November 28, 2021, https://www.scien.cx/2021/11/28/what-is-a-webhook/
HARVARD
flaviocopes.com | Sciencx Sunday November 28, 2021 » What is a webhook?., viewed ,<https://www.scien.cx/2021/11/28/what-is-a-webhook/>
VANCOUVER
flaviocopes.com | Sciencx - » What is a webhook?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/28/what-is-a-webhook/
CHICAGO
" » What is a webhook?." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/11/28/what-is-a-webhook/
IEEE
" » What is a webhook?." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/11/28/what-is-a-webhook/. [Accessed: ]
rf:citation
» What is a webhook? | flaviocopes.com | Sciencx | https://www.scien.cx/2021/11/28/what-is-a-webhook/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.