Getting "Bad Request" when trying to create a new meeting

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)


Hey @noureldinelshenawy20 !
Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!

Could you please make sure that you are generating the Bearer token correctly??
Feel free to follow the steps in this guide to achieve what you are looking for:

Cheers,
Elisa

I think I’m generating the Bearer token correctly, the response i get from (“https://zoom.us/oauth/token?grant_type=account_credentials&account_id=”+accountID) is :
{ access_token: 'eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiJlOGMzZTk4ZS1jMWIwLTRmY2MtYjZkYS1lM2ViYTYyZmYzNzgifQ.eyJ2ZXIiOjcsPrw', token_type: 'bearer', expires_in: 3599, scope: 'meeting:master meeting:read:admin meeting:write:admin meeting_token:read:admin:live_streaming meeting_token:read:admin:local_archiving meeting_token:read:admin:local_recording recording:master recording:read:admin recording:write:admin user:master user:read:admin user:write:admin' }

Hey @noureldinelshenawy20
I edited your access token in the post. Please make sure not to share personal data in the forum.
Have you tried generating the meeting using Postman to make sure that this is not related to the way you are making the request?