# {"reason":"Invalid request : Redirect URI mismatch.","error":"invalid\_request"}

**URL:** <https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902>\
**Category:** API and Webhooks\
**Created:** [September 2, 2020, 2:11pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902 "2020-09-02T14:11:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilesh](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@akhilesh](https://devforum.zoom.us/u/akhilesh)\
**Post date:** [September 2, 2020, 2:11pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/1 "2020-09-02T14:11:46Z")

</div>

**Description**  
I am getting this below response when trying to call to zoom OAuth to get token.

DEBUG|response is{“reason”:“Invalid request : Redirect URI mismatch.”,“error”:“invalid\_request”}

**Error**  
DEBUG|response is{“reason”:“Invalid request : Redirect URI mismatch.”,“error”:“invalid\_request”}

**Which App Type (OAuth)?**  
[https://zoom.us/oauth/token](https://zoom.us/oauth/token)

**Which Endpoint/s?**  
[https://zoom.us/oauth/token](https://zoom.us/oauth/token)

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:  
Http http = new Http();  
HttpRequest request = new HttpRequest();  
request.setEndpoint(‘[https://zoom.us/oauth/token’+’?grant\_type=authorization\_code’+’&code=’+loggedInUser[0].Zoom\_Refresh\_Token\_\_c+’&redirect\_uri=’+'same](https://zoom.us/oauth/token'+'?grant_type=authorization_code'+'&code='+loggedInUser%5B0%5D.Zoom_Refresh_Token__c+'&redirect_uri='+'same) as in our app i verified’);  
request.setMethod(‘POST’);  
request.setHeader(‘Authorization’,‘Basic’+’ '+Authorization);

**Screenshots (If applicable)**  
If applicable, add screenshots to help explain your problem.

**Additional context**  
Add any other context about the problem here.

---

<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 2, 2020, 2:12pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/2 "2020-09-02T14:12:03Z")

</div>

Hey @akhilesh

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

Checkout these related threads that may have the answer you are looking for:

> [@Getting Invalid request : Redirect URI mismatch error](https://devforum.zoom.us/t/-/10484):
>
> Description I’m getting a Redirect URI mismatch error when trying to get an access token after getting the code. It’s probably because I misunderstood how redirect URI works. I tried the following: Exact same URI as in app settings Same URI that I provided in oauth/authorize call when getting the code I’m getting the same error every time. Error { “reason”: “Invalid request : Redirect URI mismatch.”, “error”: “invalid\_request” } Which App Type (OAuth / Chatbot / JWT / Webhook)? OAut…

> [@OAuth with zoom - redirect uri is not used for redirect](https://devforum.zoom.us/t/-/4843):
>
> Hi, I’m currently working on an OAuth application with Zoom. Here the error occurs that the redirect Uri I specified is not accepted, but I am sent back to the zoom page. My Request URL: [https://zoom.us/oauth/authorize?client\_id=XXX&response\_type=code&redirect\_uri=http://localhost:8080/vccfg/login/oauth2/code/zoom&state=XXX](https://zoom.us/oauth/authorize?client_id=XXX&response_type=code&redirect_uri=http://localhost:8080/vccfg/login/oauth2/code/zoom&state=XXX) Location I get send to after the request: [http://zoom.us/vccfg/login/oauth2/code/zoom?code=XXX](http://zoom.us/vccfg/login/oauth2/code/zoom?code=XXX) Screenshot from my browser:

If these threads 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:** ![akhilesh](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@akhilesh](https://devforum.zoom.us/u/akhilesh)\
**Post date:** [September 2, 2020, 2:17pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/3 "2020-09-02T14:17:30Z")

</div>

nope not working 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 4, 2020, 9:25pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/5 "2020-09-04T21:25:55Z")

</div>

Hey @akhilesh,

Please checkout my post here:

> [@'Invalid request : Redirect URI mismatch.' despite using ngrok](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/4):
>
> Hey @Nad, Let me know if this helps explain things: The Redirect URI needs to be the same URI from the authorization (install URL) through to the Get Access Token request. So with these URLs set: When I go to install the app from the “Activation” page, it defaults the redirect URI to the one specified in the “Redirect URL for OAuth” input: https://zoom.us/oauth/authorize?response\_type=code&client\_id=ztmR8sxaSBGZ66b5laR7Ag&redirect\_uri=https://zoom.u…

If that does not help, please share your the redirect url you are using so I can help debug.

Thanks,  
Tommy

---

<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:** [September 9, 2020, 3:20pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/7 "2020-09-09T15:20:26Z")

</div>

Hi @akhilesh,

Can you also please whitelist the full Redirect URL as well (…/services/apexrest…) in addition to the main domain, and let me know if you’re still experiencing the error?

Thanks,  
Will

---

<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:** [September 14, 2020, 6:42pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/9 "2020-09-14T18:42:02Z")

</div>

Hey @akhilesh,

I’m getting a 500 error when I try to access your redirect URL. Can you confirm this is publicly accessible and isn’t experiencing any internal server errors?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![akhilesh](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@akhilesh](https://devforum.zoom.us/u/akhilesh)\
**Post date:** [September 17, 2020, 2:09pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/14 "2020-09-17T14:09:56Z")

</div>

Hey all figured this out with the help of Will, we need to make sure redirect url,white list has “slash” in the end like below in market place app.

Example:  
“[https://zoom.us/”](https://zoom.us/%E2%80%9D)

=========================================================

Also make sure if you are using state in your URL while getting OAuth Code use the same state in getting access token as well.

For example:

if you are using some thing like below to get Authorization Code

[https://zoom.us/oauth/authorize’+’?response\_type=code’+’&client\_id=xxxxxxxxxxxxxx’+’&redirect\_uri=‘https://zoom.us/’+’?state=’+‘test’](https://zoom.us/oauth/authorize'+'?response_type=code%27+%27&client_id=xxxxxxxxxxxxxx%27+%27&redirect_uri=%27https://zoom.us/%27+%27?state=%27+%27test%27)

Make Sure you do the same state while calling access token end point

[https://zoom.us/oauth/token’+’?grant\_type=authorization\_code’+’&code=’+OAuthCode+’&redirect\_uri=’+‘https://zoom.us/’+’?state=’+'test](https://zoom.us/oauth/token'+'?grant_type=authorization_code%27+%27&code=%27+OAuthCode+%27&redirect_uri=%27+%27https://zoom.us/%27+%27?state=%27+%27test)’

I wish the documentation is a little clear on state stuff as well

Thanks!

---

<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:** [September 18, 2020, 5:55pm UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/15 "2020-09-18T17:55:45Z")

</div>

Hey @akhilesh,

Thanks again for sharing your solution here!

Best,  
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:** [October 19, 2020, 3:55am UTC](https://devforum.zoom.us/t/reason-invalid-request-redirect-uri-mismatch-error-invalid-request/28902/16 "2020-10-19T03:55:49Z")

</div>

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