Iām trying to integrate my app but I keep getting this error
{"reason":"Invalid Grant","error":"invalid_grant"}
I am using this instruction: https://developers.zoom.us/docs/integrations/oauth/#getting-an-access-token
My code listing:
$url = 'https://zoom.us/oauth/token';
$data = [
'code' => $code,
"grant_type" => "authorization_code",
"redirect_uri" => url('/zoom-home')
];
$headers = [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic '.base64_encode(env('ZOOM_CLIENT_ID').":".env('ZOOM_CLIENT_SECRET'))
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec ($ch);
curl_close ($ch);