Sending webhooks to a postgres database
Published: 2022-09-15 00:15:49






### **What are webhooks?**

Webhooks are a powerful and valuable tool many Zoom developers use to build event triggers, automatically subscribe to data, and receive a high volume of data without needing to make API requests. To utilize them and accept the incoming requests, you'll need to setup a database, like PostgreSQL. 

In this series, we will learn more about:
* Webhooks: what are they, why use them, and the main difference between webhooks and API requests
* Example of where Zoom's webhooks can be used vs. APIs requests
* How to create an app in our Zoom Marketplace and enable event subscriptions
* Set up our webhook sample app
* Set up a Postgres database to receive and store Zoom events
* Run our webhook sample app and start storing events in your database
Let's get started!

**What are webhooks?** 

Webhooks are automated event notification messages sent from one server to another in the form of HTTP requests. 

Zoom uses webhooks to push the event-related data to your server for events your app has subscribed to. Webhook events (from Zoom) do not count toward API rate limits, making them a valuable tool for getting a large volume of data. Instead of requesting data through an API, your application tells Zoom to send data when the event happens. 

Webhooks are almost always a faster method to automatically receive data rather than making API requests.

For a further overview of webhooks, our friends at [ngrok](https://ngrok.com/partners/zoom) have created a great resource explaining [what webhooks are](https://webhooks.fyi/docs/webhook-primer) with a [directory of providers.](https://webhooks.fyi/docs/webhook-directory)


**But what is the difference between API calls and webhooks?**

API calls work on <u>request-based </u>output mechanisms, and webhooks work on <u>event-based</u> output mechanisms.

Think about this real-life example:

⏰ Let's say that every night before you go to bed, you set up an alarm for 6:00am, and you know that this alarm will go off at 6:00am. Instead of waking up in the middle of the night multiple times to check the time (like an API call), you can just sleep tight knowing that an alarm will wake you up when it's time!

Now, let's translate this example to a specific Zoom scenario:

🏢 Let's say you work in a company with around 40 people under the same Zoom account, all who host daily meetings. You've just been tasked to get all the recordings from all the meetings held during the day under your company's Zoom account. 

You could do it one of two ways. The first option is to call the recordings API to check if a meeting has ended and if it has a recording available (which, if you think about it, can be a lot because there might be at least 40 meetings to check daily). That's a lot of requests your app needs to make!

Instead, a second option would be to use event subscriptions in one of our various app types and wait for a near real-time notification of when the recordings are available. This means you won't have to continuously check if the meetings have ended or if they have recordings available.


**Let's put it all into practice:**

In the next series, we'll create a **Webhook-only app** in the [Zoom App Marketplace](https://marketplace.zoom.us/) and set up a Postgres database to receive the data. 

For this guide, we will use a [Webhook-only app](https://marketplace.zoom.us/docs/guides/build/webhook-only-app/) as it is purely a subscription to webhooks, but you can also use webhooks with OAuth and Server-to-Server OAuth apps.