# Getting status 403 when trying to get oAuth access token

**URL:** <https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818>\
**Category:** API and Webhooks\
**Created:** [September 21, 2020, 1:43am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818 "2020-09-21T01:43:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![po123](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@po123](https://devforum.zoom.us/u/po123)\
**Post date:** [September 21, 2020, 1:43am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/1 "2020-09-21T01:43:48Z")

</div>

**Description**  
I’m trying to get an oAuth access token from a user, but I keep getting the 403 forbidden error when sending the POST request.

I have followed the tutorial at [https://marketplace.zoom.us/docs/guides/auth/oauth](https://marketplace.zoom.us/docs/guides/auth/oauth) religiously. I have even checked previous threads that talked about this error, but still couldn’t fix it

**How To Reproduce (If applicable)**  
var fetchURL = ‘[https://zoom.us/oauth/token?grant\_type=authorization\_code&code=dHrAQyHrTw\_C1zkc5XgTO-fCRTjmsfWeg&redirect\_uri=http://localhost:3000/](https://zoom.us/oauth/token?grant_type=authorization_code&code=dHrAQyHrTw_C1zkc5XgTO-fCRTjmsfWeg&redirect_uri=http://localhost:3000/)’

const response = await fetch(fetchURL, {method:“POST”, headers{ “Authorization” : "Basic " + encoded\_cred}})

–\> encoded cred is encoded in base64 and contains Client\_ID:Client\_Secret

Please help, thank you.

---

<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:** [September 21, 2020, 1:44am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/2 "2020-09-21T01:44:15Z")

</div>

Hey @po123

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. 🙂

Checkout this related thread that may have the answer you are looking for:

> [@Getting 403 on call OAuth token API](https://devforum.zoom.us/t/-/9291):
>
> Description url call: [https://zoom.us/oauth/token?grant\_type=authorization\_code&code=6VzfR5yS8m\_H7AYDkARTqaVcKnotkSONA&redirect\_uri=https://localhost:44399/](https://zoom.us/oauth/token?grant_type=authorization_code&code=6VzfR5yS8m_H7AYDkARTqaVcKnotkSONA&redirect_uri=https://localhost:44399/) var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(client\_id + “:” + client\_secret); Client.DefaultRequestHeaders.Add(“Authorization”, "Basic " + Convert.ToBase64String(plainTextBytes)); HttpResponseMessage response = await Client.PostAsync(url, null); but response.StatusCode = Forbidden 403 @tommy could you help me? @Michael_Pu…

If this thread did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,  
DeveloperBot

---

<div class="post-metadata">

**Author:** ![po123](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@po123](https://devforum.zoom.us/u/po123)\
**Post date:** [September 21, 2020, 1:50am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/3 "2020-09-21T01:50:56Z")

</div>

I’ve looked there, but it doesn’t help me. Please send a developer relations member. Thanks

---

<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:** [September 22, 2020, 4:43pm UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/4 "2020-09-22T16:43:59Z")

</div>

Hey @po123,

What content type are you setting for your request?

Try setting `"Content-Type": "application/json"` in the header. 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![po123](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@po123](https://devforum.zoom.us/u/po123)\
**Post date:** [September 28, 2020, 5:02am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/6 "2020-09-28T05:02:50Z")

</div>

@tommy Hi, thanks for your reply. I tried that, but it’s still returning 403 error. I’m trying to use localhost as the redirect URI, is that potentially a problem?

Here are my headers:  
{method:“POST”, headers:{ “Authorization”:"Basic " + encoded\_cred, “Content-Type”: “application/json”}

Here is the response I received:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/f/6f1d40e74cfabe9c3f9a2be3105bca8fea63c932.png)

Thanks in advance

---

<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:** [September 29, 2020, 8:07pm UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/7 "2020-09-29T20:07:35Z")

</div>

Hey @po123,

I have just private messaged you. 🙂

Thanks,  
Tommy

---

<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:** [October 30, 2020, 6:07am UTC](https://devforum.zoom.us/t/getting-status-403-when-trying-to-get-oauth-access-token/30818/8 "2020-10-30T06:07:35Z")

</div>

Closed on October 30, 2020, 6:07am UTC

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