# Help with Zoom OAuth REST API on NodeJS

**URL:** <https://devforum.zoom.us/t/help-with-zoom-oauth-rest-api-on-nodejs/6874>\
**Category:** API and Webhooks\
**Created:** [December 1, 2019, 3:28pm UTC](https://devforum.zoom.us/t/help-with-zoom-oauth-rest-api-on-nodejs/6874 "2019-12-01T15:28:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsushant97](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vsushant97/32/2484_2.png) [@vsushant97](https://devforum.zoom.us/u/vsushant97)\
**Post date:** [December 1, 2019, 3:28pm UTC](https://devforum.zoom.us/t/help-with-zoom-oauth-rest-api-on-nodejs/6874/1 "2019-12-01T15:28:03Z")

</div>

Hi Team,

I’m developing a product in which I need to take in a users zoom account and generate an access token.  
I’m getting the authorization code but for the next step where I request access token, I’m getting an response error as ‘Invalid Client ID or Secret’. But when checked, both the ID and secret are the same as in my App Marketplace. Using Developer account for testing and it’s an Admin Level App.  
Endpoint/s  
[https://zoom.us/oauth/token](https://zoom.us/oauth/token)

Code:

```auto
    if(authorization_code){
        var auth = "Basic "+ new Buffer(CLIENT_ID+":"+CLIENT_SECRET).toString('base64')
        var header = {"Authorization":auth}
        var url = `https://zoom.us/oauth/token?grant_type=authorization_code&code=${authorization_code}&redirect_uri=http://localhost:4000/callback`
        axios.post(url,header).then(result => {
            console.log(result.response)
        }).catch(e => {
            console.log(e)
        })
    }

```

Error:  
data: {  
reason: ‘Invalid client\_id or client\_secret’,  
error: ‘invalid\_client’  
}

Please let me know what mistake I’m making in the process

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [December 3, 2019, 12:31am UTC](https://devforum.zoom.us/t/help-with-zoom-oauth-rest-api-on-nodejs/6874/2 "2019-12-03T00:31:53Z")

</div>

Hey @vsushant97, thanks for posting and using Zoom!

Can you try using the `Buffer.from(CLIENT_ID+":"+ CLIENT_SECRET).toString('base64')` syntax?

> <https://stackoverflow.com/questions/6182315/how-to-do-base64-encoding-in-node-js/6182519#6182519>

Or try passing in an empty object as the 2nd param, and the headers as the third like this:

`axios.post(url, {}, header)`

Let me know if that works!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 7:06pm UTC](https://devforum.zoom.us/t/help-with-zoom-oauth-rest-api-on-nodejs/6874/3 "2020-08-21T19:06:04Z")

</div>


