Skip to content

Instantly share code, notes, and snippets.

View joshuawoodward's full-sized avatar

Joshua Woodward joshuawoodward

View GitHub Profile
var request = require('request');
const client_id = '<client_id>';
const client_secret = '<client_secret>';
const redirect_uri = 'http://localhost:8080/oauth';
module.exports = function (req, res) {
//this will check if the code parameter is in the url, if not the most liekly case is that this is the user's inital visit to oauth and we need to redirect them (step 1)
//if there is a code, it most likely means they were redirected here from zoom oauth screen
<?php
//using composer
require __DIR__ . '/vendor/autoload.php';
// JWT PHP Library https://github.com/firebase/php-jwt
use \Firebase\JWT\JWT;
//function to generate JWT
function generateJWT () {
@joshuawoodward
joshuawoodward / downgrade.php
Created November 2, 2017 19:49
Find users that haven't logged in
<?php
$api_key = '';
$api_secret = '';
date_default_timezone_set('America/Los_Angeles');
$users = get_users();
echo "Found ". count($users) . " users\r\n";
@joshuawoodward
joshuawoodward / signature.php
Created August 2, 2017 19:04
How to generate a signature for zoom in PHP
/**
* Generate signature for ZoomMtg JSSDK.
*
* @param string $api_key You REST API Key
* @param string $api_secret You REST API Secret
* @param int $meeting_number The meeting number you are creating the signature for
* @param int $role Role that this signature is for; 0 for participant, 1 for host
*
* @return string Returns the signature string
*
@joshuawoodward
joshuawoodward / zoom_webhook.php
Last active August 5, 2019 07:01
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"){