Hi developers, by using a business account on ZOOM, My company asks me for a project to handle the course meetings per day at the zoom platform, but I have a problem with the (page-size) because sometimes I have more than 300 meetings per day.
please help me ASAP.
it’s JWT App
documentation Source: https://marketplace.zoom.us/docs/api-reference/zoom-api/dashboards/dashboardmeetings
The Endpoint https://api.zoom.us/v2/metrics/meetings)
const superagent = require("superagent")
exports.handleMeetingsId = (req, res) => {
let now = new Date();
let nowDate = now.getDate()
let nowMonth = now.getMonth()+1;
let nowYear = now.getFullYear();
let yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1, 0, 0, 0)
let yesterdayDate = yesterday.getDate();
let yesterdayMonth = yesterday.getMonth();
let yesterdayYear = yesterday.getFullYear();
let meetingIdArr = [];
superagent
.get('https://api.zoom.us/v2/metrics/meetings')
.auth(process.env.JWT, { type: 'bearer' })
.query({
type: 'past',
from: `${yesterdayYear}-${yesterdayMonth}-${yesterdayDate}`,
to: `${yesterdayYear}-${yesterdayMonth}-${yesterdayDate}`,
page_size: 300,
})
.then(response => {
response.body.meetings.map(meeting => {
let durationTime = meeting.duration;
let durationInMilliSecands = durationTime.split(":").reduce((acc,durationTime) => ((60 * acc) + +durationTime) *1000);
// ((60 * ((60 * HHHH) + MM)) + SS)*1000 // basically what happened
if(durationInMilliSecands > 600000){ // more than 10 min
meetingIdArr.push(meeting.id)
}
})
})
.then(() => {
res.send(meetingIdArr)
})
}
Regards
As-har