Unable to download cloud storage recording via curl api

Hi,

I m using API (https://api.zoom.us/v2/meetings/{metting_id}/recordings) to get meeting details via JWT Token. its work fine for me. In this response i m getting Download & Play URL without any extensions.

eg:
/us02web.zoom.us/rec/play/xxxx…
/us02web.zoom.us/rec/download/xxxx…

If i paste download url in the browser then recording successfully downloading. but i want to download video recording via script. Currently i m using PHP script to download and save recording on my server. but i m unable to save recording in mp4 format on my server its save as a text file.

So please help me to how to download recorded video from cloud storage from zoom to my server.

Have you found a solution to this issue?

Have you found a solution to this issue? We also have problems downloading files in our office from the cloud service. We have some important files there, and it would not be good if an error in the system deleted the files. Luckily some of the files are saved with the https://fastupload.io/en. We use this website to share files in our office, and it converts the files into a link, and anyone who has the link can download the files on their computer. We have saved some of the files, but unfortunately, not all of them.

Hi,

you can download recorded video from zoom and save in folder using below code. replace your meeting_id and jwt_token.

$metting_id = ‘xxxxx’;

$curl = curl_init();
curl_setopt_array($curl, array (
CURLOPT_URL => “https://api.zoom.us/v2/meetings/“.$metting_id.”/recordings”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “GET”,
CURLOPT_HTTPHEADER => array(
“authorization: Bearer YOUR_JWT_TOKEN”,
“cache-control: no-cache”
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo “cURL Error #:” . $err;
}
else {
$result = json_decode($response, true);
$recording_files = $result[‘recording_files’];

for($i=0; $i<count($recording_files); $i++){

	$src = $recording_files[$i]['download_url'];
	$fileName = $recording_files[$i]['id'].'.mp4';
	$dest = getcwd() . "/videos/" . $fileName;
	$ch = curl_init($src);
	curl_exec($ch);

	if (!curl_errno($ch)) {
	    $info = curl_getinfo($ch);
	    $downloadLink = $info['redirect_url'];
	}

	curl_close($ch);

	if($downloadLink) {
	    copy($downloadLink, $dest);
	}
}

}