# Unable to get access token with authorization code

**URL:** <https://devforum.zoom.us/t/unable-to-get-access-token-with-authorization-code/78278>\
**Category:** Authentication\
**Created:** [November 4, 2022, 6:51am UTC](https://devforum.zoom.us/t/unable-to-get-access-token-with-authorization-code/78278 "2022-11-04T06:51:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reyaz.ahmed](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@reyaz.ahmed](https://devforum.zoom.us/u/reyaz.ahmed)\
**Post date:** [November 4, 2022, 6:51am UTC](https://devforum.zoom.us/t/unable-to-get-access-token-with-authorization-code/78278/1 "2022-11-04T06:51:39Z")

</div>

Hi,  
I am trying to generate access token by passing authorization code to the below api  
[https://zoom.us/oauth/token](https://zoom.us/oauth/token)  
but always getting below error  
{  
“reason”: “Invalid authorization code xxxxxxxx”,  
“error”: “invalid\_grant”  
}

Below is my node.js code to generate access token I am using node-fetch:

const url = `https://zoom.us/oauth/token?grant_type=authorization_code&code=${code}&&redirect_uri=${process.env.ZOOM_REDIRECT_URI}`;

```
const request = await fetch(url, { 
                                                                   method:'POST',
                                                                   headers: {
     'Content-Type': 'application/x-www-form-urlencoded',
     'Authorization' : 'Basic ' + Buffer.from( username+ ':' + password).toString('base64'),
 }
});

```

Here username and password are clientId and secret key, I have tried both with development credentials and production.

Details:  
App Type: Zoom App

---

<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:** [January 5, 2023, 6:25pm UTC](https://devforum.zoom.us/t/unable-to-get-access-token-with-authorization-code/78278/2 "2023-01-05T18:25:39Z")

</div>

Hi @reyaz.ahmed  
Thanks for reaching out to the Zoom Developer forum and welcome to our community, I am happy to help here!  
Have you been able to fix this issue? or do. you still need some assistance?
