Firebase实时数据库能否作WebHook端点?Zoom WebHook无法更新数据库求助
Hey there! I’ve used Firebase as a webhook endpoint multiple times, so I can spot exactly what’s going wrong here.
The Core Problem
Your Angular app sends a JSON payload (Content-Type: application/json) which works perfectly with Firebase Realtime Database’s REST API. But Zoom’s webhook sends data as x-www-form-urlencoded form data—and Firebase’s native REST endpoint doesn’t parse this format by default. That’s why your database isn’t updating when Zoom triggers events.
Solution 1: Use Firebase Cloud Functions to Transform the Request (Recommended)
The most reliable fix is to set up a lightweight HTTP Cloud Function that acts as a middleman: it accepts Zoom’s form data, converts it to JSON, and then writes it to your database. Here’s a step-by-step implementation:
Set up the Cloud Function
Create a new function with Express to handle form data parsing:const functions = require("firebase-functions"); const express = require("express"); const bodyParser = require("body-parser"); const admin = require("firebase-admin"); // Initialize Firebase Admin SDK admin.initializeApp(); const app = express(); // Parse x-www-form-urlencoded data (Zoom's format) app.use(bodyParser.urlencoded({ extended: true })); app.post("/zoom-webhook", (req, res) => { // Extract and structure Zoom's form data into a JSON object const zoomEventData = { host_id: req.body.host_id, status: req.body.status, id: req.body.id, uuid: req.body.uuid }; // Write to your Firebase Realtime Database (match your original path) return admin.database().ref("zoom") .push(zoomEventData) .then(() => { // Zoom expects a 200 OK response to confirm delivery res.status(200).send("Webhook received and saved"); }) .catch((error) => { functions.logger.error("Error saving data:", error); res.status(500).send("Failed to save webhook data"); }); }); // Deploy the function exports.zoomWebhookHandler = functions.https.onRequest(app);Deploy and Update Zoom’s Webhook Endpoint
- Deploy this function to Firebase using
firebase deploy --only functions. - Copy the deployed function’s URL (it’ll look like
https://<region>-<project-id>.cloudfunctions.net/zoomWebhookHandler) and set it as Zoom’s webhook endpoint.
- Deploy this function to Firebase using
Add Zoom Webhook Signature Validation (Optional but Recommended)
Zoom signs its webhook requests to verify authenticity. You can add code to the function to check this signature—refer to Zoom’s documentation for the exact validation steps (you’ll need your Zoom webhook secret).
Solution 2: Check if Zoom Can Send JSON Payloads
Some webhook services let you configure the payload format. If Zoom allows switching to application/json instead of form data, you can skip the Cloud Function and use your original Firebase REST URL directly. However, most meeting services like Zoom default to form data, so this might not be an option.
Key Notes
- Firebase Realtime Database’s native REST endpoint only processes requests with
Content-Type: application/json. Any other content type will not write data to the database. - Always return a 200 OK response quickly from your Cloud Function—Zoom will retry failed requests if it doesn’t get a timely response.
内容的提问来源于stack exchange,提问作者David Shakun

