I'm trying to create a service that uses Zoom's API at the company's hackathon, so I did some preliminary research.
JWT tokens or OAuth 2.0 are available as possible ones. I used the JWT token that can be used immediately that is displayed on the screen.
The zoom user registered in the company's co.jp domain is under the company account and could not get the JWT token on the spot (I did not have the authority to create the app), so I used a separate personal Gmail. I created a user, created an app, and got a JWT token.
I chose ** Chalice **, which is a framework that allows you to easily create API Gateway + Lambda API. It's very easy because you can write a function and deploy various things with a single deploy command without being aware of the time-consuming settings around permissions and API Gateway settings.
Chalice https://github.com/aws/chalice
Once deployed, the REST API URL will be displayed, so register it in ʻEvent notification endpoint URLfrom the zoom app management screen. Since it is the REST API URL + function name to be registered, it looks like this.
https://xxxxxxx.execute-api.ap-northeast-1.amazonaws.com/api/webhook`
There are so many webhook events in zoom, so check the events you want to receive.
Is the webhook URL alive? I will check it quickly. The GET method returned a response immediately, but the webhook is accessed by the POST method. It is necessary to specify to receive the POST method on the Chalice side.
app.py
@app.route('/webhook', methods=['POST'])
def webhook():
print('received event:')
request = app.current_request
app.log.debug(json.dumps(request.to_dict()));
app.log.debug(json.dumps(request.json_body))
#Deploy
chalice deploy --profile xxxxx
#Wait for the log
chalice logs -f --profile xxxxx
Waiting for the log like this, let's make a request with Postman. In about 2-3 seconds, the log came to the terminal.
At this point, I also found that if I start / end a zoom meeting, I can receive the actual webhook and output the log. Like postman, the log will flow in about 2-3 seconds, so I think that it is notified with almost no delay.
Next time, I will try to execute the Zoom API based on the received information.