一、注册zoom 账号、以便在zoom app maketplace创建app。
![](https://i-blog.csdnimg.cn/direct/9e86e50d991a4da583608f12196d85c3.png)
二、安装git、node.js、vscode开发环境(略)。
三、注册ngrok账号,获得一个免费的https静态域名。
![](https://i-blog.csdnimg.cn/direct/ac0a3a13260c4fb683d793efbb09d3d2.png)
四、配置zoom app(wxl),设置上一步获得的https静态域名,验证地址为/auth
![](https://i-blog.csdnimg.cn/direct/1b618b11657943d19cf40dd9bb6d2abd.png)
五、事件订阅(会议开始和会议结束,也可以订阅其它事件)
![](https://i-blog.csdnimg.cn/direct/6b1f19a8df9844e390b46b530af7fb06.png)
六、选择在哪些界面使用app(wxl)、设置主页和允许访问的域名。
![](https://i-blog.csdnimg.cn/direct/656b804a22c84fa7b4d790f1cd58c3df.png)
七、设置访问范围
![](https://i-blog.csdnimg.cn/direct/50f97dc50fb04356a7e5d9832767b0c9.png)
八、生成共享app(wxl)的链接
![](https://i-blog.csdnimg.cn/direct/92dfda4c697345ab84754b592d7ebcc8.png)
九、开始开发过程(power shell)
1、git clone https://github.com/zoom/zoomapps-sample-js
2、cd zoomapps-sample-js
3、npm install
4、配置.env(参数来源创建app的过程,SESSION_SECRET为随机初始化值)
![](https://i-blog.csdnimg.cn/direct/4b322d1c9d7242a0b79c4a2acbb77824.png)
5、在app.js文件的95行-149行增加/webhook的处理(接收会议开始和结束事情的订阅信息)
app.post('/webhook', (req, res) => {
var response
console.log(req.headers)
console.log(req.body)
// construct the message string
const message = `v0:${req.headers['x-zm-request-timestamp']}:${JSON.stringify(req.body)}`
const hashForVerify = crypto.createHmac('sha256', secretToken).update(message).digest('hex')
// hash the message string with your Webhook Secret Token and prepend the version semantic
const signature = `v0=${hashForVerify}`
// you validating the request came from Zoom https://marketplace.zoom.us/docs/api-reference/webhook-reference#notification-structure
if (req.headers['x-zm-signature'] === signature) {
// Zoom validating you control the webhook endpoint https://marketplace.zoom.us/docs/api-reference/webhook-reference#validate-webhook-endpoint
if(req.body.event === 'endpoint.url_validation') {
const hashForValidate = crypto.createHmac('sha256', secretToken).update(req.body.payload.plainToken).digest('hex')
response = {
message: {
plainToken: req.body.payload.plainToken,
encryptedToken: hashForValidate
},
status: 200
}
console.log(response.message)
res.status(response.status)
res.json(response.message)
} else {
response = { message: 'Authorized request to Zoom Webhook sample.', status: 200 }
console.log(response.message)
res.status(response.status)
res.json(response)
// business logic here, example make API request to Zoom or 3rd party
}
} else {
response = { message: 'Unauthorized request to Zoom Webhook sample.', status: 401 }
console.log(response.message)
res.status(response.status)
res.json(response)
}
})
6、npm start dev
7、ngrok http --domain=shortly-adapted-akita.ngrok-free.app 3000
![](https://i-blog.csdnimg.cn/direct/1d0b360e849e42d995a33c91dcd80de9.png)
8、访问静态域名
![](https://i-blog.csdnimg.cn/direct/08f11131043d401880665407045dd00c.png)
9、点击click here 安装app到zoom中
![](https://i-blog.csdnimg.cn/direct/deec0a668c5546739afe115e70f7f729.png)
10、允许后
![](https://i-blog.csdnimg.cn/direct/8ab3399c88674acabcccdcb9a1e679f9.png)
11、打开zoom应用,app(wxl)显示就在zoom窗口中了。
![](https://i-blog.csdnimg.cn/direct/2846fd962ff3489783e8178dbbfc1e86.png)
12、点击开始视频会议,获得开始会议事件的订阅信息
![](https://i-blog.csdnimg.cn/direct/17257770cfb94a7cb6253b64acb0d858.png)
13、点击结束会议,获得结束会议事件订阅信息
![](https://i-blog.csdnimg.cn/direct/03a7646ef5d24e41a6fcb5d3caf5afa5.png)