基于 Zoom REST API 实现,采用 Server-to-Server OAuth 令牌模式,内置令牌缓存与自动刷新。
包信息
- NuGet 包:
Bitzsoft.Integrations.VideoConference.Zoom - 接口:
IVideoConferenceService - 鉴权:Server-to-Server OAuth(AccountId + ClientId + ClientSecret)
- Provider ID:
zoom
配置
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
AccountId | string | 是 | — | 账户 ID(Account ID) |
ClientId | string | 是 | — | 应用 ID(Client Id) |
ClientSecret | string | 是 | — | 应用密钥(Client Secret) |
BaseUrl | string | 否 | https://api.zoom.us | Zoom REST API 基地址 |
OAuthBaseUrl | string | 否 | https://zoom.us | Server-to-Server OAuth 令牌端点基地址 |
HttpClientName | string | 否 | VideoConferenceZoom | 业务 HttpClient 命名 |
TokenHttpClientName | string | 否 | VideoConferenceZoomToken | 令牌刷新专用 HttpClient 命名 |
{ "VideoConference": { "Zoom": { "AccountId": "your-account-id", "ClientId": "your-client-id", "ClientSecret": "your-client-secret" } }}注册
// 方式一:IConfiguration(默认读取 "VideoConference:Zoom" 配置节)services.AddZoomVideoConference(configuration);
// 方式二:委托配置services.AddZoomVideoConference(options =>{ options.AccountId = "your-account-id"; options.ClientId = "your-client-id"; options.ClientSecret = "your-client-secret";});使用示例
var meeting = await service.CreateMeetingAsync(new CreateMeetingRequest{ Subject = "Sprint Planning", StartTime = DateTimeOffset.Parse("2026-08-03T14:00:00Z"), EndTime = DateTimeOffset.Parse("2026-08-03T15:00:00Z"), Attendees = [new() { Email = "dev@example.com" }]});
// 更新会议await service.UpdateMeetingAsync(new UpdateMeetingRequest{ MeetingId = meeting.MeetingId, Subject = "Sprint Planning (Updated)"});
// 查询录制var recordings = await service.ListRecordingsAsync(meeting.MeetingId);鉴权机制
- 令牌获取:POST
/oauth/token,HTTP Basic Auth(ClientId:ClientSecret),grant_type=account_credentials,account_id参数。 - 令牌缓存:
ZoomTokenManager为 Singleton,过期前 5 分钟刷新。 - 业务请求:按请求注入
Authorization: Bearer {token}头。 - HTTP
401 Unauthorized触发令牌失效自愈。
已知限制
所有供应商标记为 Preview。Zoom 时间格式为 ISO 8601。