Hello, I am using OAuth token to schedule meeting using zoom api. But after 1 hour access token expired and when I try to generate new access token with old refresh token It gives the following issue:
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://zoom.us/oauth/token
resulted in a 401 Unauthorized
response: {“reason”:“Invalid Token!”,“error”:“invalid_request”}
I am working in PHP.
Hey @marketing4
Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question.
Checkout these related threads that may have the answer you are looking for:
Hello,
We have a Zoom integration through a Zoom marketplace app and we’re seeing some odd patterns regarding refresh tokens.
We’re following the docs in https://devdocs.zoom.us/docs/authorization/oauth-with-zoom
To summarize:
At the end of the OAuth flow, Zoom provides us both an access and a refresh token.
When the access token expires, we use the refresh token to get a new access and refresh token. We store both of them for the next requests.
Everything works smoothly, the weird thin…
I need to get a new access token and a refresh token using OAuth via cURL. I have worked with Jakob at Zoom support and he helped me set it up in Postman 2. When I copy that into a cURL statement from my software (FileMaker Pro cURL function), I do not get back both tokens.
Instead, I get this error: {“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”}
The cURL request I copied from Postman looks like this:
xcurl --location --request POST ‘https://zoom.us/oauth/token?gra…
Hi all!
Refresh token doesn’t work
First getting refresh token:
Uri: https://zoom.us/oauth/token
Content: grant_type=refresh_token&refresh_token=eyJhbGciOiJIUzUxMiJ9.eyJ2ZXIiOiI2IiwiY2xpZW50SWQiOiI0MUdyaVR6VVF4NlQ0dHpkWndSTDVBIiwiY29kZSI6IldFOWhpODJCQzdfSnUzU3FURGZRWkswdXpLRkxQWm41QSIsImlzcyI6InVybjp6b29tOmNvbm5lY3Q6Y2xpZW50aWQ6NDFHcmlUelVReDZUNHR6ZFp3Ukw1QSIsImF1dGhlbnRpY2F0aW9uSWQiOiJlNDUwNzUwZWI3N2NlN2UwZWRlMDliYzI5MDE3YTI0ZiIsImVudiI6W251bGxdLCJ1c2VySWQiOiJKdTNTcVREZlFaSzB1ektGTFBabjV…
If these threads did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.
Thanks,
DeveloperBot
Hi ,
these threads are not working for me. i am getting this issue last 1 one week. please reply asap.
Hi @marketing4 ,
Please reference these steps for refreshing a token:
Note that the latest refresh token must always be used for the next refresh request.
Let me know if this helps,
Will
Hi will,
I have done all these things but its not working for me.
this is my code
$refresh_token = $db->get_refersh_token();
$client = new GuzzleHttp\Client(['base_uri' => 'https://zoom.us']);
$response = $client->request('POST', '/oauth/token', [
"headers" => [
"Authorization" => "Basic ".base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
],
'form_params' => [
"grant_type"=>"refresh_token",
"refresh_token"=>$refresh_token
],
]);
$db->update_access_token($response->getBody());
getting the error
Fatal error : Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://zoom.us/oauth/token
resulted in a 401 Unauthorized
response: {“reason”:“Invalid Token!”,“error”:“invalid_request”} in /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111 Stack trace: #0 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL) #3 /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #4 /var/www/html/skilrock-zoom-final/v in /var/www/html/skilrock-zoom-final/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 111
i am getting this error in postman
Did you solve this error?
No,you have any solution to fix this issue.
Hey @marketing4 ,
I just DM’d you—can you reply to my message with the requested value so that I can help debug?
Thanks,
Will
marketing4
(Skilrock)
October 22, 2020, 10:03am
11
where can i see your DM’d ?
Hey @marketing4 ,
You should have received an email or be able to view a DM from the top right hand side of your Forum account/dropdown menu.
If you still have trouble seeing the DM, you can send us an email at developersupport@zoom.us . Please include the value you’re passing for your authorization header with us either of these places (do not post this here, as this contains sensitive credentials). This will help us to debug!
Thanks,
Will
marketing4
(Skilrock)
October 26, 2020, 10:15am
14
Hi,
Please respond so that we can close this issue.
Thanks,
Ankur
will.zoom
(Will)
October 26, 2020, 10:57pm
15
Hi @marketing4 ,
Thanks for sharing this. I’m not seeing any issues with your Authorization headers. I think there is likely still an issue with the refresh_token
value you’re passing in the form_params for your refresh request.
Can you please send us an email to developersupport@zoom.us with the values you’re passing for your refresh_token? We should be able to check our logs to look into this further. Please do not share this here, as these are sensitive details.
Thanks,
Will
system
(system)
Closed
November 28, 2020, 8:38pm
17
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.