Always create new Oauth app for access token

Hi, yesterday I created OAuth app in my free zoom account and generated an access token with that. Today I hit the same endpoint to get the access token but it shows me the error of invalid code. So I created a new OAuth app and it worked for me to get acess token. My concern is that do I need to create OAuth app, again and again, to get the access token for creating a meeting.

Thanks in advance.

Error
{
“reason”: “Invalid authorization code K9k6mpjDMS_HE7Lug8_SlOhpVysqucDUg”,
“error”: “invalid_request”
}

OAuth App
Knowing the endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

Endpoint/s
https://zoom.us/oauth/token?grant_type=authorization_code&code=K9k6mpjDMS_HE7Lug8_SlOhpVysqucDUg&redirect_uri=http://04078411cf67.ngrok.io

Hi @bhumika,

You do not need to create a new OAuth app to get an access_token each time.

To clarify, your access_token will expire after 1 hour. You need to use the refresh_token that is returned when you initially call our OAuth endpoint to retrieve a new access_token when it expires (or before).

You can read about this process here:

Let me know if this helps to clarify,
Will

Hi, @will.zoom Thank you for your help. I have another doubt in this Is there a way to generate OAuth code using Reactjs or Nodejs because when I try to hit Error - Zoom{client_id}&redirect_uri={url}
It asks me to authorize the app first then it generates code automatically but can we generate code without interacting with Oauth account. Is there any way to do it.

Thanks

Hey @bhumika,

Thank you for your question. There isn’t a way to generate the code on your end. In order to maintain the functionality and security of our OAuth flow, this code will need to be generated by Zoom and passed to the OAuth Redirect URI.

I hope that helps! Let me know if you have any questions.

Thanks,
Max

My scenario is that I would like to host multiple meetings using multiple users so is it possible to use the same OAuth app for that creating multiple meetings.

If yes then
I would like to know If I create sub-users from my account then the OAuth app will be accessible to all the sub-accounts and also they can generate code using their accounts.

If no then
I have to create a user-managed Oauth app and every sub-user has their own app for hosting the meeting. And they can generate its code by logging into their accounts.

Please guide me through this I just want to confirm the way I am using is correct or is there any other way to work on my scenario.

Thanks in advance

Hi @bhumika,

Yes, this is possible. One OAuth App can support multiple parties.

If yes then
I would like to know If I create sub-users from my account then the OAuth app will be accessible to all the sub-accounts and also they can generate code using their accounts.

Sub accounts will need to install/authorize OAuth apps separately from a master account. However, users under the same account would need to authorize an app individually if it’s a user-managed app. If it’s an account-level app, then an admin or owner could authorize an app on behalf of all users under the account.

You can see the difference between user and account level oauth apps here:

Let me know if this helps. :slight_smile:

Best,
Will

@will.zoom Thanks for the clarification. I would like to know is there a way to create a free sub-user account for the development purpose.

HI @bhumika,

While I can appreciate how this would be helpful, at this time we don’t support it for development purposes. If you wish to work with master/sub account setup, you will need to reach out to partner-success@zoom.us to get this enabled.

Thanks,
Will

@will.zoom Thank you very much. Can you please help me with the package I need to buy for creating sub-users with hosting and attending meetings?

Hi @bhumika,

For details on the required package for a master/sub account set up, partner-success@zoom.us will be your best resource. :slight_smile:

Thanks!
Will