Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Zoom webhook RECORDING_MEETING_COMPLETED workaround
<?php
if( isset($_POST["type"]) ) {
/**
Currently the recording ready notification is not consistent with the other notifications.
The others return status, uuid, host_id, id. Recording ready returns type and content (content is a urlencoded json).
The below code will transform it into what is needed temporarly, without breaking your implemention when a fix is made, this block of code can latter be removed when the bug is fixed.
*/
if($_POST["type"] === "RECORDING_MEETING_COMPLETED"){
//set status to type
$_POST["status"] = "RECORDING_MEETING_COMPLETED";
//get uuid/host_id from content
$json = json_decode($_POST["content"]);
$_POST["uuid"] = $json->uuid;
$_POST["host_id"] = $json->host_id;
}
}
if( isset($_POST["status"]) ){
switch( $_POST["status"] ){
case "JBH":
//JBH Logic
break;
case "JOIN":
//JOIN Logic
break;
case "STARTED":
//STARTED Logic
break;
case "ENDED":
//ENDED Logic
break;
case "RECORDING_MEETING_COMPLETED":
//RECORDING_MEETING_COMPLETED Logic
// the below is psudeo code and depends heavily on your implemention of interacting will zoom rest api
//implement a call out to https://api.zoom.us/v1/recording/get
$response = call_zoom('/v1/recording/get', array("meeting_id" => $_POST["uuid"]));
// response will be JSON
$response = json_decode($response);
if( $response && $response->recording_files){
foreach ($response->recording_files as $recording) {
//check if video file, can contain audio files too
//note: can contain more than one video file as well, depending on length of meeting recordings may be split across files
if($recording->file_type === "MP4"){
//implement a download funciton
$file = download($recording->download_url);
//implement where you want to store
upload($file);
}
}
}
break;
}
}
@Silver-Seagull

This comment has been minimized.

Copy link

commented Sep 28, 2017

Hi @joshuawoodward, I believe there is a typo on line 22: "swtich" instead of switch() :)

@joshuawoodward

This comment has been minimized.

Copy link
Owner Author

commented Nov 17, 2017

@Silver-Seagull thanks!

@antonkorotkov

This comment has been minimized.

Copy link

commented Aug 22, 2018

@joshuawoodward hello! not sure if you are the right person to ask this about but where can I get some documentation related to webhooks? I'd like to see complete description of each webhook type and what data they send to my endpoint. I there something I can referencing? Example above does not look complete.

@antonkorotkov

This comment has been minimized.

Copy link

commented Aug 22, 2018

Looks like I found documentation: https://developer.zoom.us/docs/webhooks/ Will hope it is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.