定制 msaaq/zoom-php-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

msaaq/zoom-php-sdk

最新稳定版本:v1.0.1

Composer 安装命令:

composer require msaaq/zoom-php-sdk

包简介

README 文档

README

Below is an example of how this SDK can be used in a Laravel-style project to support both OAuth and Server-to-Server Zoom integrations.

Initialization Example

use Msaaq\Zoom\AccessToken;
use Msaaq\Zoom\Zoom;
use Msaaq\Zoom\Clients\OAuthClient;
use Msaaq\Zoom\Clients\ServerToServerOAuthClient;

// OAuth setup
$client = new OAuthClient(
    clientId: 'client_id',
    clientSecret: 'client_secret',
    redirectUri: 'redirect_url'
);

// Server-to-Server setup
$client = new ServerToServerOAuthClient(
    clientId: 'client_id',
    clientSecret: 'client_secret',
    accountId: 'account_id',
);

$accessToken = new AccessToken(
    client: $client,
    accessToken: 'your_zoom_access_token',
    refreshToken: 'your_refresh_token',
    onTokenChange: function (array $newTokens) {
        // store new token values
    }
);

$zoom = new Zoom($accessToken);
$userInfo = $zoom->user()->get();

// Get All Meetings
$zoom->user()->meetings()->all();
// Create a Meeting
$meeting = new \Msaaq\Zoom\Models\Meeting();
$meeting->topic = 'Meeting Topic';
$zoom->user()->meetings()->create($meeting);

// Get All Webinars
$zoom->user()->webinars()->all();
// Create a Webinar
$zoom->user()->webinars()->create(// Webinar object);

OAuth Flow Example

// Step 1: Redirect user to Zoom OAuth
$client = new OAuthClient(
    clientId: 'client_id',
    clientSecret: 'client_secret',
    redirectUri: 'redirect_url'
);

$url = $client->getAuthorizationUrl();

return redirect()->to($url);

// Step 2: Handle callback
$tokenData = $client->createToken($code);

Refresh Token Example

$newTokens = $client->refreshToken('existing_refresh_token');

This example demonstrates how to:

  • Support both OAuth and Server-to-Server authentication
  • Automatically refresh tokens and persist new ones
  • Interact with the Zoom API using Laravel-inspired syntax

统计信息

  • 总下载量: 2.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-04-21