By the number of threads about it I believe it’s the most common issue with Zoom API :).
I’m building a WordPress website with a webinar registration form.
You can see it here: Hope Trust » Hope Trust: Creating a Comprehensive Special Needs Plan – It Takes a Village
The form uses Zoom API to add the participants through Zoom OAuth application. For the first hour after I install an application (and an auth token is created) the form works perfecly. Auth token and refresh token are saved in a database. During this first hour I can refresh the token with no problem (both tokens are being saved in a database). Refreshing the token also works through Postman.
The problem occurs after this first hour. When I try to register for a webinar I’m getting an exception 401, because auth token is no longer valid. So I’m sending a POST request to refresh the token but getting this error:
“reason”: “Invalid Token!”,
What’s interesting I’m getting the same error when trying through Postman. Remember - it was working fine during the first hour.
I think I tried everything. Reinstalling the application doesn’t help - after one hour the problem is back.
I’m running out of ideas.
Here’s my PHP refresh token request:
$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 ], ]);