# Getting 400 status, When trying to get Access Token

**URL:** <https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [March 27, 2024, 1:49am UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601 "2024-03-27T01:49:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![devanuruddha](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/devanuruddha/32/57953_2.png) [@devanuruddha](https://devforum.zoom.us/u/devanuruddha)\
**Post date:** [March 27, 2024, 1:49am UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601/1 "2024-03-27T01:49:06Z")

</div>

**Hi!**  
We are getting an API issue In Zoom.  
We are using the OAuth2.0 to Authenticate the Zoom with our application. There **sometimes** when we trying to Authenticate Zoom we are getting a 400 status. This thing happen when we trying to get the Token first time by passing the `CODE` which sent from Zoom.

### Description

In fist time we going to Authenticate Zoom with our application it going to work, Then we disconnect it ( remove the previous authenticate credentials ) and going to authenticate again, In this time when passing the CODE to get the Token, we are getting 400 status from the ZOOM API. Even we tried multiple times this 400 status coming again and again.  
After Sometime passed (1hr or more) then again we going to Authenticate it going to work without any issue.  
This thing happen again and again, we didn’t able to find the root case for this issue.

### Error

400 Bad Request.  
( Not getting more error info to get an Idea )

### API Endpoints

_URL use to get the_ **CODE**

```auto
`https://zoom.us/oauth/authorize?response_type=code&client_id=${client_id}&redirect_uri=${encode(redirectURL)}`;

```

_After getting the CODE, we making the Initial Req to get Access-Token._

```auto
Req-Type: [POST]
host = "zoom.us"
path = "/oauth/token"

// Req Header
headers = {
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
    Authorization: `Basic ${(Buffer.from(`${client.client_id}:${client.client_secret}`)).toString('base64')}`,
},

//Req Body
body = {
   code: initCode,
   redirect_uri: redirectURL,
   grant_type: 'authorization_code',
}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [March 27, 2024, 8:47pm UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601/2 "2024-03-27T20:47:58Z")

</div>

Hi @devanuruddha ,

If this is periodically happening, please submit a [support ticket](https://developers.zoom.us/support/) and provide the following:

- developer email associated with app
- client id
- tracking id(s) from the 400 Bad Request response headers

This way our service engineering team can track down the requests and see why they are sometimes failing

---

<div class="post-metadata">

**Author:** ![devanuruddha](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/devanuruddha/32/57953_2.png) [@devanuruddha](https://devforum.zoom.us/u/devanuruddha)\
**Post date:** [March 28, 2024, 6:11am UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601/3 "2024-03-28T06:11:57Z")

</div>

Hi Gianni  
Thank you for the Reply.

Sure i will make a support ticket and see.  
That `Tracking ID` you mention, Is it’s value contain in this `x-zm-trackingid` key in Req Header ?

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [March 29, 2024, 5:27am UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601/4 "2024-03-29T05:27:11Z")

</div>

Yes exactly @devanuruddha 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 1, 2024, 4:18pm UTC](https://devforum.zoom.us/t/getting-400-status-when-trying-to-get-access-token/106601/5 "2024-04-01T16:18:03Z")

</div>

Closed on April 1, 2024, 4:18pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
