This is a simple FastAPI app that handles Zoom Webhooks.
The goal of this app is to handle Zoom Webhooks and to provide a simple way to extend the app with custom handlers.
If you want to know more about the architecture of this app, you can read the architecture.md file.
$ git clone https://github.com/SamuelGuillemet/zoom-python-webhook.git
- Python >= 3.11
- Poetry
The .env.sample
file contains the list of all the environment variables that you can define.
If your are in production mode, you can define the following variables in your .env.production
file or directly in your environment variables:
ZOOM_WEBHOOK_SECRET_TOKEN
: The secret token that you have defined in your Zoom App.
If your are in development mode, you can define the following variables in your .env.development
file:
ZOOM_WEBHOOK_SECRET_TOKEN
: The secret token that you have defined in your Zoom App.
There is a Dockerfile that you can use to build the image and run the app.
$ docker compose up -d --build
Poetry will take all the information on the pyproject.toml
file and will install all its dependencoies.
You can install Poetry using the following command:
Linux or Mac:
$ curl -sSL https://install.python-poetry.org | python3 -
Windows:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
Source: https://python-poetry.org/docs/#installing-with-the-official-installer
Then, you can install the dependencies with the following command:
Virtual environment if you use Conda
- Start the conda environment.
- Create a virtual environment under the
.venv
folder. - Deactivate the conda environment.
$ conda activate your_env
$ python -m venv .venv
$ conda deactivate
$ poetry install
$ source .venv/bin/activate # or poetry shell
$ pre-commit install
Then, you can run the app with the following command from the root folder:
$ uvicorn src.app.main:app --reload --reload-dir=./src/app
endpoint.url_verification
zoomroom.checked_in
zoomroom.checked_out
zoomroom.sensor_data
- Create a new component in the
src/app/components
folder. - The structure of the component should be the following:
└── your_component
├── __init__.py
├── handler.py
└── schema.py
- In the
handler.py
file, you should create a new function that will handle the event. The function should be take the following arguments:- body (dict): The body of the request
- In the
schema.py
file, you should create 2 new Pydantic models:- The first model should be used to validate the body of the request.
- The second model should be used to validate the response of the handler function.
- In the
__init__.py
file, you must put the following code:
from .handler import your_handler_function
from .schema import YourResponseSchema
event_name = "your.event.name"
handler_function = your_handler_function
response_model = YourResponseSchema
- All the components arle loaded dynamically in the
src/app/api/v1/endpoints/webhook.py
file.