"code":124,"message":"Invalid access token."

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?

@touch.ag how are you generating your access token?

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

@touch.ag I’ll PM you for this