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

Hello,
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:
https://zoom.us/oauth/authorize?client_id=6wG1sdT5QOyC3As57R4SA&response_type=code&redirect_uri=http://localhost:3000/de/user/redirect/zoom&code_challenge=<CODE_CHALLENGE>

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

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

Headers:
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>

Headers:
Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)

Response:
{
“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,
      grant_type: HTTPCLIENT.OAuth.GRANT_TYPE.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?

@vicky1999

Please watch sessions here

Zoom OAuth

Part - 1
Part - 2