Zoom oauth refresh token giving { "reason": "Invalid Token!", "error": "invalid_grant" }

I have created an App in zoom marketplace and is in draft status currently. I was able to authorize with the app and get the code, access and refresh token for the first time.
But after an hour, when I tried to call the refresh token API, I am getting the response:
“reason”: “Invalid Token!”,
“error”: “invalid_grant”

Steps I followed:

FIrst we are checking if the user exist in our db if the user does not exist, then we will call the API:

After allowing the access, I am getting the code which I use to call the oauth/token API and get the access and refresh token:

Endpoint: https://zoom.us/oauth/token

code: <CODE>
grant_type: authorization_code
code_verifier: <CODE_VERIFIER>

Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)

This API is giving me the access and refresh token.

when I tried to use the refresh token to get a new access token, it is not working. I am pretty sure the refresh token is valid and I am calling the API in POST method.

Endpoint: https://zoom.us/oauth/token

grant_type: refresh_token
refresh_token: <REFRESH_TOKEN>

Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)

“reason”: “Invalid Token!”,
“error”: “invalid_grant”

I am following all the instructions mentioned in the oauth document: OAuth for user authorized apps

@vicky1999 what language are you using ? do you have some code samples?

@vicky1999 Please correct the body of the request as like below

NodeJS sample:

 var payload = qs.stringify({
      refresh_token: zoomAuth.refresh_token,
      redirect_uri: `${process.env.HOST}/${process.env.ZOOM_OAUTH_REDIRECT_URI}`,

@chunsiong.zoom I am using nodejs for this with the default fetch API. Even with postman, it is not working

@naeem.ahmedk I am still getting the same invalid token issue even trying with postman. Can you please share me the request json to check this in postman?

@vicky1999 can you check out this guide to setup your postman?


Please watch sessions here

Zoom OAuth

Part - 1
Part - 2