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

**URL:** <https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157>\
**Category:** Meetings\
**Created:** [June 26, 2022, 8:36am UTC](https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157 "2022-06-26T08:36:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noureldinelshenawy20](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/noureldinelshenawy20/32/38823_2.png) [@noureldinelshenawy20](https://devforum.zoom.us/u/noureldinelshenawy20)\
**Post date:** [June 26, 2022, 8:36am UTC](https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157/1 "2022-06-26T08:36:24Z")

</div>

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](https://api.zoom.us/v2/users/%7BmyEmail%7D/meetings)”  
I get code 400.

```auto

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)

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 27, 2022, 8:32pm UTC](https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157/2 "2022-06-27T20:32:58Z")

</div>

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:

> [@How to user Server-to-Sever OAuth app with Postman](https://devforum.zoom.us/t/how-to-user-server-to-sever-oauth-app-with-postman/70848):
>
> How to use our Server-to-Server OAuth with Postman? As some of you might be aware of, our JWT app is being deprecated by June 2023 and we encourage you to migrate to the newly introduced [Server-to-Server OAuth App](https://marketplace.zoom.us/docs/guides/build/server-to-server-oauth-app) That being said, here is a quick and simple guide on how to use or new app with Postman As stated in our documentation here: This new app type facilitates OAuth-authenticated requests between servers without end-user involvement. And this grant type enable your private server a…

Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![noureldinelshenawy20](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/noureldinelshenawy20/32/38823_2.png) [@noureldinelshenawy20](https://devforum.zoom.us/u/noureldinelshenawy20)\
**Post date:** [June 28, 2022, 9:17am UTC](https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157/3 "2022-06-28T09:17:43Z")

</div>

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=](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' }`

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 28, 2022, 12:58pm UTC](https://devforum.zoom.us/t/getting-bad-request-when-trying-to-create-a-new-meeting/71157/4 "2022-06-28T12:58:03Z")

</div>

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?
