Skip to content

prajna-h/webhook-sample-node.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zoom Webhook Sample Node.js

Use of this sample app is subject to our Terms of Use.


NOTE: This Sample App has been updated to use the Webhook Secret Token instead of the Webhook Verification Token to validate requests are sent from Zoom.


This is a Node.js / Express server that receives Zoom Platform Webhooks and Zoom Video SDK Webhooks .

If you would like to skip these steps and just deploy the finished code to Heroku, click the Deploy to Heroku button. (You will still need to configure a few simple things, so skip to Deployment.)

Deploy

Installation

In terminal, run the following command to clone the repo:

$ git clone https://github.com/zoom/webhook-sample-node.js.git

Setup

  1. In terminal, cd into the cloned repo:

    $ cd webhook-sample-node.js

  2. Then install the dependencies:

    $ npm install

  3. Create an environment file to store your Webhook Secret Token:

    $ touch .env

  4. Add the following code to the .env file, and insert your Webhook Secret Token found on the Features page in the Zoom App Marketplace:

    ZOOM_WEBHOOK_SECRET_TOKEN=ZOOM_WEBHOOK_SECRET_TOKEN_HERE
    

    Zoom Webhook Secret Token

    The Webhook Secret Token allows you to verify webhook requests come from Zoom and for Zoom to validate that you control your webhook endpoint.

  5. Save and close .env.

  6. Start the server:

    $ npm run start

  7. We need to expose the local server to the internet to accept post requests, we will use Ngrok (free) for this.

    Once installed, open a new terminal tab and run:

    $ ngrok http 4000

    NOTE: I've put ngrok in my PATH so I can call it globally.

  8. Copy the ngrok https url displayed in terminal. In your apps Event notification endpoint URL input, paste your ngrok https url. Remember to include /webhook path.

    Example: https://abc123.ngrok.io/webhook

    Zoom Webhook Configuration

  9. Choose the events you'd like to subscribe to.

    Zoom Webhook Events

  10. Click "Save".

Usage

  1. Trigger the respective Webhook.

    For example, if you chose the Start Meeting Webhook, start a Zoom Meeting. You will see the Webhook headers and payload logged in terminal.

    {
      "host": "abc123.ngrok.io",
      "user-agent": "Zoom Marketplace/1.0a",
      "content-length": "335",
      "authorization": "{LEGACY_WEBHOOK_VERIFICATION_TOKEN}",
      "clientid": "{CLIENT_ID}",
      "content-type": "application/json; charset=utf-8",
      "x-forwarded-for": "{X_FORWARDED_FOR}",
      "x-forwarded-proto": "https",
      "x-zm-request-timestamp": "X_ZM_REQUEST_TIMESTAMP",
      "x-zm-signature": "v0={HASHED_WEBHOOK_SECRET_TOKEN}",
      "x-zm-trackingid": "{X_ZM_TRACKINGID}",
      "accept-encoding": "gzip"
    }
    {
      "event": "meeting.started",
      "payload": {
        "account_id": "{ACCOUNT_ID}",
        "object": {
          "duration": 0,
          "start_time": "2021-11-02T20:43:19Z",
          "timezone": "America/Denver",
          "topic": "{TOPIC}",
          "id": "{MEETING_ID}",
          "type": 4,
          "uuid": "{MEETING_UUID}",
          "host_id": "{HOST_ID}"
        }
      },
      "event_ts": 1635885799302
    }

Deployment

Heroku

If you used the "Deploy to Heroku" button, fill in the blanks.

  1. Enter a name for your app on the page the button took you to (or leave it blank to have a name generated for you), and fill in the values for these:

    • ZOOM_WEBHOOK_SECRET_TOKEN (Your Zoom Webhook Secret Token, found on your App's Features page)
  2. Then click "Deploy App".

  3. Now you can use your deployed url Heroku provides as the Event notification endpoint URL. Copy the Heroku https url from the "View" button. In your apps Event notification endpoint URL input, paste your Heroku https url. Remember to include /webhook path.

    Example: https://abc123.herokuapp.com/webhook

If you cloned this repo, use the Heroku CLI to deploy your server.

  1. In terminal, create a Heroku app:

    $ heroku create

  2. Add your files:

    $ git add -A

  3. Commit your files:

    $ git commit -m "deploying to heroku"

  4. Deploy your server by pushing your files to Heroku:

    $ git push origin heroku

  5. Navigate to your app on the Heroku dashboard, click settings, and add your App's Webhook Secret Token in the Config Variables:

    • ZOOM_WEBHOOK_SECRET_TOKEN (Your Zoom Webhook Secret Token, found on your App's Features page)
  6. Now you can use your deployed url Heroku provides as the Event notification endpoint URL. Copy the Heroku https url displayed in terminal. In your apps Event notification endpoint URL input, paste your Heroku https url. Remember to include /webhook path.

    Example: https://abc123.herokuapp.com/webhook

Other Server Hosting

For Other Server Hosting information, see this tutorial.

Need help?

If you're looking for help, try Developer Support or our Developer Forum. Priority support is also available with Premier Developer Support plans.

About

Receive Zoom Webhooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%