touch.ag
(carlos)
November 14, 2023, 9:54am
1
Hi team,
I’m facing the error “Invalid access token” (code error 124) while trying to create a new meeting via the API.
I remove app and restart again but the same code error
The scopes I have are : meeting:write meeting:read user_zak:read
Please tell me why I am getting this error and how to remove it?
chunsiong.zoom
(Chun Siong (tag me for response))
November 15, 2023, 4:00am
2
@touch.ag how are you generating your access token?
touch.ag
(carlos)
November 19, 2023, 10:04pm
3
Hi Chun Siong for your reply:
i generate my access token like this :
$private function getAccessToken($code){
$CLIENT_ID = “xxxxxxxxx”;
$CLIENT_SECRET = “xxxxxxxxxxxxxxxx”;
$REDIRECT_URI = ‘xxxxxxxxxxxxxxxxxxxxxxxx’;
$token_url = 'https://zoom.us/oauth/token';
$token_data = array(
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => $REDIRECT_URI
);
$token_headers = array(
'Authorization: Basic ' . base64_encode("$CLIENT_ID:$CLIENT_SECRET")
);
$ch = curl_init($token_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($token_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $token_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$token_response = curl_exec($ch);
$token_data = json_decode($token_response, true);
if ($token_data && isset($token_data['access_token'])) {
return $token_data['access_token'];
} else {
return false;
}
}
thank
chunsiong.zoom
(Chun Siong (tag me for response))
November 20, 2023, 5:50am
4
@touch.ag I’ll PM you for this