@@ -66,16 +66,18 @@ async function generateZoomJWTBearerAccessToken (apiKey) {
66
66
*
67
67
* @param {Date } startTime the start time of the meeting
68
68
* @param {Integer } duration the duration of the meeting
69
+ * @param {String } timezone the timezone of the meeting
69
70
* @returns Zoom API response
70
71
*/
71
- async function createZoomMeeting ( startTime , duration ) {
72
+ async function createZoomMeeting ( startTime , duration , timezone ) {
72
73
const { accessToken, zoomAccountApiKey } = await generateZoomJWTBearerAccessToken ( )
73
74
74
75
// POST request details in Zoom API docs:
75
76
// https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate
76
77
const res = await axios . post ( 'https://api.zoom.us/v2/users/me/meetings' , {
77
78
type : 2 ,
78
79
start_time : startTime . toISOString ( ) ,
80
+ timezone,
79
81
duration
80
82
} , {
81
83
headers : {
@@ -94,11 +96,12 @@ async function createZoomMeeting (startTime, duration) {
94
96
*
95
97
* @param {Date } startTime the start time of the meeting
96
98
* @param {Integer } duration the duration of the meeting
99
+ * @param {String } timezone the timezone of the meeting
97
100
* @returns The meeting urls for the Zoom meeting
98
101
*/
99
- async function generateZoomMeetingLink ( startTime , duration ) {
102
+ async function generateZoomMeetingLink ( startTime , duration , timezone ) {
100
103
try {
101
- const { meeting, zoomAccountApiKey } = await createZoomMeeting ( startTime , duration )
104
+ const { meeting, zoomAccountApiKey } = await createZoomMeeting ( startTime , duration , timezone )
102
105
103
106
// learn more: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate#responses
104
107
console . log ( meeting . start_url , 'Zoom meeting link for host' )
0 commit comments