Basically im using a server to server OAuth app, ive authenticated with the credentials and recieved the access token, but when I try to make a request to “https://api.zoom.us/v2/users/{myEmail}/meetings”
I get code 400.
const request = await fetch("https://zoom.us/oauth/token?grant_type=account_credentials&account_id="+accountID,{
method: 'POST',
headers:{
Host: "zoom.us",
/**The credential below is a sample base64 encoded credential. Replace it with "Authorization: 'Basic ' + Buffer.from(your_app_client_id + ':' + your_app_client_secret).toString('base64')"
**/
// Authorization: 'Basic abcdsdkjfesjfg',
Authorization: 'Basic ' + Buffer.from(clientID + ':' + clientSecret).toString('base64')
},
})
const RequestIntoJSON = await request.json();
const AccessToken = RequestIntoJSON.access_token;
console.log(AccessToken)
const CreateMeetingRequest = await fetch("https://api.zoom.us/v2/users/{myEmail}/meetings",
{
method:"post",
headers:{
"Host": "zoom.us",
"Authorization": "Bearer " + AccessToken,
"content-type":"application/json",
},
body:{
"topic": "Discussion about today's Demo",
"type": 2,
// "start_time": "2021-03-18T17:00:00",
"duration": 20,
"timezone": "India",
"password": "1234567",
"agenda": "We will discuss about Today's Demo process",
"settings": {
"host_video": true,
"participant_video": true,
"cn_meeting": false,
"in_meeting": true,
"join_before_host": false,
"mute_upon_entry": false,
"watermark": false,
"use_pmi": false,
"approval_type": 2,
"audio": "both",
"auto_recording": "local",
"enforce_login": false,
"registrants_email_notification": false,
"waiting_room": true,
"allow_multiple_devices": true
}}
})
console.log(await CreateMeetingRequest)