I updated the access token and refresh tokens and latest tokens but still get the response as "{"code":124,"message":"Invalid access token."}" I am following the oauth process create zoom meeting function:
public function create_zoom_meeting($meeting_details) {
$res = false;
if(!empty($meeting_details)) {
$post_fields = [
"topic"=> !empty($meeting_details['topic']) ? $meeting_details['topic'] : "",
"type"=> "2",
"start_time"=> $meeting_details['start_time'],
"duration" => $meeting_details['duration'],
"timezone" => !empty($meeting_details['time_zone']) ? $meeting_details['time_zone'] :"Asia/Kolkata",
"settings" => [
"host_video"=> "true",
"participant_video"=> "false",
"join_before_host"=> "true",
"jbh_time" => "5",
"registration_type" => "0",
"auto_recording" => "none",
"meeting_authentication" => "true"
]
];
$headers = [
"Content-Type : application/json",
"authorization : Bearer {$this->access_token}",
"Host: zoom.us"
];
$res = $this->post_curl_request('https://api.zoom.us/v2/users/me/meetings', json_encode($post_fields), $headers);
}
var_dump($res);
return $res;
}
my curl request
private function post_curl_request($url, $post_body = [], $headers = []) {
var_dump($post_body, $headers);
$curl = curl_init();
$curl_opt_array = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 30,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_POST => 1,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $post_body
);
curl_setopt_array($curl,$curl_opt_array);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
how can I fix this issue