# Invalid authorization code xx\_p7RJBA with status Bad request when requesting for access token after authozation

**URL:** <https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214>\
**Category:** API and Webhooks\
**Created:** [January 11, 2021, 1:33pm UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214 "2021-01-11T13:33:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![siva](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/siva/32/18530_2.png) [@siva](https://devforum.zoom.us/u/siva)\
**Post date:** [January 11, 2021, 1:33pm UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/1 "2021-01-11T13:33:46Z")

</div>

Getting Invalid authorization code xxxxxxxxxxxxxxxxxxxxxxxxxxx\_p7RJBA with status Bad request when requesting for access token after authozation using [https://zoom.us/oauth/token](https://zoom.us/oauth/token) api

**Error**  
StatusCode: BadRequest, Content-Type: application/json;charset=UTF-8, Content-Length: -1)  
and  
{“reason”:“Invalid authorization code xxxxxxxxxxxxxxxxxxxxxxxxxxx\_p7RJBA”,“error”:“invalid\_request”}

Response Url: [https://zoom.us/oauth/token/?grant\_type=authorization\_code&code=xxxxxxxxxxxxxxxxxxxxxxxxxxx\_p7RJBA&redirect\_uri=https:%2F%2Flocalhost:44315%2F](https://zoom.us/oauth/token/?grant_type=authorization_code&code=xxxxxxxxxxxxxxxxxxxxxxxxxxx_p7RJBA&redirect_uri=https:%2F%2Flocalhost:44315%2F)

Getting this issue in our both Development and Production environments and all the keys and ids are regenerated and updated in our application.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [January 11, 2021, 10:04pm UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/2 "2021-01-11T22:04:29Z")

</div>

Hey @siva,

Can you confirm that you’re grabbing the authorization code from the redirect URL after your user installs/authorizes the app? You should be grabbing this from a URL that looks something like this, where [zoom.us](http://zoom.us) would be the redirect URL you provided in your App:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/d/7d44a404a8ae5e297c25014e8f92eb60a468b63b.png)

Let me know—thanks,  
Will

---

<div class="post-metadata">

**Author:** ![siva](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/siva/32/18530_2.png) [@siva](https://devforum.zoom.us/u/siva)\
**Post date:** [January 12, 2021, 4:25am UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/3 "2021-01-12T04:25:06Z")

</div>

Hi @will.zoom, thanks for your quick reply.

Yes when user authorizes the app, zoom sending an authorization code to the redirect url. The same code we are using to get the use access token.

Sample redirect url:  
Production : [EventTitans](https://www.eventtitans.com/ZoomAuthorization?code=SJN2fx3MIf_TQoFObagTMuANlA_p7RJBA)

Development : [https://localhost:44315/Home/GetZoomCode?code=CE8ZAxPLIs\_TQoFObagTMuANlA\_p7RJBA](https://localhost:44315/Home/GetZoomCode?code=CE8ZAxPLIs_TQoFObagTMuANlA_p7RJBA)

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [January 12, 2021, 4:45pm UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/4 "2021-01-12T16:45:37Z")

</div>

Hi @siva,

It looks like you might be using a local URL. Please make sure your development redirect URL is available on the internet. Can you try hosting your localhost on a server such as [ngrok](https://ngrok.com/)?

Let me know if this helps,  
Will

---

<div class="post-metadata">

**Author:** ![siva](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/siva/32/18530_2.png) [@siva](https://devforum.zoom.us/u/siva)\
**Post date:** [January 13, 2021, 4:25am UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/5 "2021-01-13T04:25:58Z")

</div>

Hi @will.zoom ,

i will check after hosting our localhost on ngrok.

and can you check the production redirect url below

[https://www.eventtitans.com/ZoomAuthorization?code=SJN2fx3MIf\_TQoFObagTMuANlA\_p7RJBA](https://www.eventtitans.com/ZoomAuthorization?code=SJN2fx3MIf_TQoFObagTMuANlA_p7RJBA)

Earlier it was working fine but suddenly we started facing this issue in our both development and production environments

Thank you

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [January 13, 2021, 10:05pm UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/6 "2021-01-13T22:05:45Z")

</div>

Hi @siva,

Your base domain ([eventtitans.com](http://eventtitans.com)) works fine for me, but your ZoomAuthorization path throws a 404 error for me. Note that your redirect URL should direct users to a valid page—this can even simply be your landing page/homepage. The code will automatically be appended to your designated redirect URL once the user authorizes your OAuth App.

Thanks,  
Will

---

<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:** [February 13, 2021, 8:05am UTC](https://devforum.zoom.us/t/invalid-authorization-code-xx-p7rjba-with-status-bad-request-when-requesting-for-access-token-after-authozation/40214/7 "2021-02-13T08:05:52Z")

</div>

Closed on February 13, 2021, 8:05am UTC

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