Invalid Token! Zoom API fail to generate access token using refresh_token

I am using Zoom api to refresh access token if expired. I have tried everything but its always gives me invalid_grant(Invalid Token!) error. I also tried this but problem seem unsolvable. The token I generate is never used but still it gives me invalid_grant error.
Here is detail code

Hi @s.m.sami125
Thanks for reaching out to the Zoom Developer Forum and welcome to our community, I am happy to help here!

Could you please confirm that you are using the right client id and client secret to make the call to the refresh token?

I will send you a private message so I can help you debug this issue further
Best,
Elisa

Hi Elisa, in my company we are starting to use the ZOOM API to generate meetings in our training platform. My question is focused on two topics:

  1. Is there a way to have a unique and permanent TOKEN.
  2. I have the same problem as the reported error. it does not allow me to update the token I have saved.

Hi @gestionetmultimedia
Thanks for reaching out to us, I am happy to help here.

  1. Is there a way to have a unique and permanent TOKEN.

No, but you can use the Server to Server Oauth token and generate tokens as you need them. There is no limit on how many tokens you request

  1. I have the same problem as the reported error. it does not allow me to update the token I have saved.

What app type are you using? Can you confirm you are using an Oauth app ? Can you share with me the request you are making to update this token?

1 Like

Maybe this functionality is just hidden in your example but are you saving the refresh token obtained from the ‘oauth_token()’ function? The refresh token is a distinct object from the access token and that is what needs to be passed in the ‘refresh_token()’ function.

$refreshToken = json_decode($response->getBody()->getContents(), true)[“refresh_token”];

1 Like

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