# Custom Redirect URI parameters?

**URL:** <https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496>\
**Category:** API and Webhooks\
**Created:** [March 24, 2020, 8:27pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496 "2020-03-24T20:27:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sripberger](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@sripberger](https://devforum.zoom.us/u/sripberger)\
**Post date:** [March 24, 2020, 8:27pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/1 "2020-03-24T20:27:26Z")

</div>

**Description**  
I’m looking to integrate some Zoom api calls into my company’s app. Quite simply, we just want to let users who have Zoom accounts to create meetings quickly by just clicking a button within our app.

I’m going through the example OAuth2 app and it all looks good, except for one thing. When a user authorizes this for the first time, we of course send them out to [https://zoom.us/oauth/authorize](https://zoom.us/oauth/authorize), with all the necessary arguments.

When they come back into our app, we want to send them back to wherever they were. To accomplish this, there’s a bunch of state that we need to restore. The `authorize` endpoint seems to only send users back to a redirect\_uri with the authorization code and nothing else, however. So when they come back into our app, we have no way of knowing what the user was doing before they left.

When interacting with other OAuth2 services-- including GSuite, Facebook, and so on-- we have the ability of customizing the redirect uri on a per-request basis, so that state information like this can be preserved by passing it through additional query string arguments. Is there no feature like this for Zoom API, or am I simply missing something?

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth

**Which Endpoint/s?**  
authorize

---

<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 24, 2020, 9:43pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/2 "2020-03-24T21:43:47Z")

</div>

Hey @sripberger, thanks for posting and using Zoom!

This is possible by attaching a `state` query param to the end of the installation url.

For example: [https://zoom.us/oauth/authorize?response\_type=code&client\_id=XO8c5xFdQVqGAgGB3utlRA&redirect\_uri=https://zoom.us&state=stateparam](https://zoom.us/oauth/authorize?response_type=code&client_id=XO8c5xFdQVqGAgGB3utlRA&redirect_uri=https://zoom.us&state=stateparam)

Let me know if that helps!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![sripberger](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@sripberger](https://devforum.zoom.us/u/sripberger)\
**Post date:** [March 24, 2020, 10:13pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/3 "2020-03-24T22:13:58Z")

</div>

This should be exactly what I need. 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:** [March 24, 2020, 10:17pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/4 "2020-03-24T22:17:58Z")

</div>

You are welcome! 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![victor-zmurl](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/victor-zmurl/32/13199_2.png) [@victor-zmurl](https://devforum.zoom.us/u/victor-zmurl)\
**Post date:** [May 14, 2020, 6:13am UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/5 "2020-05-14T06:13:46Z")

</div>

Hi Tommy, does the redirect URI only allow the `state` param?

I was trying to use the `next` param in the redirect and it was working on development, but it just broke when I pushed to production with the Zoom API saying that I had a URI mismatch.

---

<div class="post-metadata">

**Author:** ![victor-zmurl](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/victor-zmurl/32/13199_2.png) [@victor-zmurl](https://devforum.zoom.us/u/victor-zmurl)\
**Post date:** [May 14, 2020, 5:16pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/6 "2020-05-14T17:16:37Z")

</div>

I’m still getting issues when using the `state` param instead of the `next` param. This is pretty frustrating / confusing 😞.

In the Zoom OAuth docs, the documentation states that you need to pass a `redirect_uri` in most of the functions. Should this `redirect_uri` be a string with or without the `state` query param?

---

<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:** [May 19, 2020, 4:32pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/7 "2020-05-19T16:32:41Z")

</div>

Hey @victor-zmurl,

The `state` param should not be attached to the redirect url while [requesting an access token](https://marketplace.zoom.us/docs/guides/auth/oauth#step-2-request-access-token), it should only be on the [authorize url](https://marketplace.zoom.us/docs/guides/auth/oauth#step-1-request-user-authorization):

```nohighlight
https://zoom.us/oauth/authorize?response_type=code&client_id=7lstjK9NTyett_oeXtFiEQ&redirect_uri=https://yourapp.com&state={userState}

```

Basically the state is handled by Zoom, and not needed to pass in as the redirect url. So this url would also work:

```nohighlight
https://zoom.us/oauth/authorize?response_type=code&client_id=7lstjK9NTyett_oeXtFiEQ&state={userState}&redirect_uri=https://yourapp.com

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![josharcher](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/josharcher/32/3523_2.png) [@josharcher](https://devforum.zoom.us/u/josharcher)\
**Post date:** [June 30, 2020, 5:50pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/8 "2020-06-30T17:50:31Z")

</div>

@tommy How do you encode the state param if you want to use a javascript object? Could we use `encodeURIComponent(JSON.stringify(object))` ?

Seems to throw an error on the API side

---

<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:** [July 1, 2020, 10:18pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/9 "2020-07-01T22:18:11Z")

</div>

Hey @josharcher,

If you are using a JavaScript / JSON object as the state query param value, try base 64 encoding it:

> **[Base64 Encode and Decode - Online](https://www.base64encode.org/)**
>
> Encode to Base64 or Decode from Base64 with advanced formatting options. Enter our site for an easy-to-use online tool.

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, 10:32pm UTC](https://devforum.zoom.us/t/custom-redirect-uri-parameters/9496/10 "2020-08-21T22:32:14Z")

</div>

Closed on August 21, 2020, 10:32pm UTC


