[PYTHON] I did a preliminary survey of the API that receives Zoom meeting entry / exit webhooks on Lambda (1)

I'm trying to create a service that uses Zoom's API at the company's hackathon, so I did some preliminary research.

Zoom API authentication

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.

Prepare the URL of the webhook

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.

Check API with Postman

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.

Recommended Posts

I did a preliminary survey of the API that receives Zoom meeting entry / exit webhooks on Lambda (1)
I did a little research on the class
I built an application with Lambda that notifies LINE of "likes" using the Qiita API
A memo that reproduces the slide show (gadget) of Windows 7 on Windows 10.
I made a slack bot that notifies me of the temperature
I did a lot of research on how Python is executed
A story that visualizes the present of Qiita with Qiita API + Elasticsearch + Kibana
zoom I tried to quantify the degree of excitement of the story at the meeting
I wrote a corpus reader that reads the results of MeCab analysis
I measured the run queue wait time of a process on Linux
I created a Slack bot that confirms and notifies AWS Lambda of the expiration date of an SSL certificate