# Bad request when getting OAuth code from iframe

**URL:** <https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390>\
**Category:** API and Webhooks\
**Created:** [March 4, 2020, 3:49am UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390 "2020-03-04T03:49:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pthkit](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@pthkit](https://devforum.zoom.us/u/pthkit)\
**Post date:** [March 4, 2020, 3:49am UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390/1 "2020-03-04T03:49:38Z")

</div>

My application calls the Zoom API get results with an iframe and it worked perfectly until this morning.

It now keeps redirecting me to the Bad Request error page when I try to retrieve the code from [https://zoom.us/oauth/authorize?response\_type=code&client\_id=XXXX](https://zoom.us/oauth/authorize?response_type=code&client_id=XXXX).

I can get it working if I access it through a stand alone tab, but I have to go through the “Grant Authorization” process everytime I call the api. I remember that I only had to grant access once and the page would give me the code directly from then on.

I need the iframe access method to keep the application automatic.  
Is the new update or some settings with my application/account causing the problem?

---

<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:** [March 4, 2020, 5:45pm UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390/2 "2020-03-04T17:45:45Z")

</div>

Hey @pthkit, thanks for posting and using Zoom!

In the meantime, I believe the proper flow would be to authorize the user once, and then store the access\_token and refresh\_token. Docs here:

[https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![pthkit](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@pthkit](https://devforum.zoom.us/u/pthkit)\
**Post date:** [March 5, 2020, 2:54am UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390/3 "2020-03-05T02:54:06Z")

</div>

Thanks Tommy!

I should have read the docs till the end before I finished the app. I am using the proper flow right now and everything works fine. Thanks a lot!

---

<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:** [March 5, 2020, 4:45pm UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390/4 "2020-03-05T16:45:02Z")

</div>

Happy to help!

Glad you were able to resolve the issue! 🙂

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:29pm UTC](https://devforum.zoom.us/t/bad-request-when-getting-oauth-code-from-iframe/8390/5 "2020-08-21T19:29:07Z")

</div>

Closed on August 21, 2020, 7:29pm UTC


