Hi, I am following the php tutorial on zoom api php
I can create the tokens with a callback and store in db. My issue is simply updating the access token gives a 400 error on the refresh token line to be exact. I cant see an issue with my access/refresh token i just created and update. I am using cakephp4 and zoom api.
//my update access token is
$refresh_token = $zoomOauth->refresh_token;
$client = new Client(['base_uri' => 'https://zoom.us']);
$response = $client->request('POST', '/oauth/token', [
"headers" => [
"Authorization" => "Basic ". base64_encode($zoom->zoom_client_key.':'.$zoom->zoom_secret_key)
'form_params' => [
"grant_type" => "refresh_token",
"refresh_token" => $refresh_token //error here? refresh token is correct?
Client error: POST https://zoom.us/oauth/token resulted in a 400 Bad Request response:
how do i fix this error as it makes no sense to me
current data from Oauth i have store
access_token => ‘[REDACTED]’
yes i tried $token = json_decode($response->getBody()->getContents());
what happens now is that the code will work if i rerun the callback and get new tokens. If do a debug which is printing the variable contents to screen this will cause an invalid grant and going back and re running the function wont fix the invalid grant error.