Google Meet
2026-03-24
新闻来源:网淘吧
围观:79
电脑广告
手机广告
Google Meet
通过托管的OAuth认证访问Google Meet API。创建和管理会议空间,列出会议记录,并获取参与者信息。
快速开始
# 创建会议空间
python <<'EOF'
import urllib.request, os, json
data = json.dumps({}).encode()
req = urllib.request.Request('https://gateway.maton.ai/google-meet/v2/spaces', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
基础URL
https://gateway.maton.ai/google-meet/{原生API路径}
将{native-api-path}替换为实际的Google Meet API端点路径。网关将请求代理到meet.googleapis.com并自动注入您的OAuth令牌。
认证
所有请求都要求在Authorization头部中包含Maton API密钥:
Authorization: Bearer $MATON_API_KEY
环境变量:将您的API密钥设置为MATON_API_KEY。
export MATON_API_KEY="YOUR_API_KEY"
获取您的API密钥
- 请登录或在以下网址创建账户maton.ai
- 前往maton.ai/settings
- 复制您的API密钥
连接管理
请在以下网址管理您的Google OAuth连接https://ctrl.maton.ai。
列出连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-meet&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
创建连接
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'google-meet'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
获取连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "google-meet",
"metadata": {}
}
}
在浏览器中打开返回的URL以完成 OAuth 授权。
删除连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
指定连接
如果您有多个 Google Meet 连接,请使用Maton-Connection请求头来指定要使用哪一个:
python <<'EOF'
import urllib.request, os, json
data = json.dumps({}).encode()
req = urllib.request.Request('https://gateway.maton.ai/google-meet/v2/spaces', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最早创建的)活动连接。
API 参考
空间
创建空间
POST /google-meet/v2/spaces
Content-Type: application/json
{}
响应:
{
"name": "spaces/abc123",
"meetingUri": "https://meet.google.com/abc-defg-hij",
"meetingCode": "abc-defg-hij",
"config": {
"accessType": "OPEN",
"entryPointAccess": "ALL"
}
}
获取空间
GET /google-meet/v2/spaces/{spaceId}
更新空间
PATCH /google-meet/v2/spaces/{spaceId}
Content-Type: application/json
{
"config": {
"accessType": "TRUSTED"
}
}
结束活动通话
POST /google-meet/v2/spaces/{spaceId}:endActiveConference
会议记录
列出会议记录
GET /google-meet/v2/conferenceRecords
带过滤条件:
GET /google-meet/v2/conferenceRecords?filter=space.name="spaces/abc123"
获取会议记录
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}
参与者
列出参与者
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/participants
获取参与者
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/participants/{participantId}
参与者会话
列出参与者会话
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/participants/{participantId}/participantSessions
录制内容
列出录制内容
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/recordings
获取录制内容
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/recordings/{recordingId}
转录文本
列出转录文本
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/transcripts
获取转录文本
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/transcripts/{transcriptId}
列出转录条目
GET /google-meet/v2/conferenceRecords/{conferenceRecordId}/transcripts/{transcriptId}/entries
代码示例
JavaScript
// 创建一个会议空间
const response = await fetch(
'https://gateway.maton.ai/google-meet/v2/spaces',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
},
body: JSON.stringify({})
}
);
const space = await response.json();
console.log(`会议链接: ${space.meetingUri}`);
Python
import os
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'
}
# 创建一个会议空间
response = requests.post(
'https://gateway.maton.ai/google-meet/v2/spaces',
headers=headers,
json={}
)
space = response.json()
print(f"会议 URL: {space['meetingUri']}")
备注
- 空间是可重复使用的持久性会议室
- 会议记录在会议开始时创建,用于追踪会议历史
- 访问类型:
开放(任何拥有链接的人),受信(仅限组织成员),受限(仅限受邀者) - 录制和转录需要启用录制功能的 Google Workspace
- 重要提示:使用 curl 命令时,如果 URL 包含方括号,请使用
curl -g以禁用通配符解析 - 重要提示:当将 curl 输出通过管道传递给
jq或其他命令时,环境变量如$MATON_API_KEY在某些shell环境中可能无法正确展开。通过管道传输时,您可能会遇到"无效API密钥"的错误。
错误处理
| 状态码 | 含义 |
|---|---|
| 400 | 缺少Google Meet连接 |
| 401 | 无效或缺失的Maton API密钥 |
| 429 | 请求频率受限(每个账户每秒10次请求) |
| 4xx/5xx | 来自Google Meet API的透传错误 |
故障排除:无效API密钥
当您收到"无效API密钥"错误时,在确认存在问题之前,请务必按以下步骤操作:
- 检查
MATON_API_KEY环境变量是否已设置:
echo $MATON_API_KEY
- 通过列出连接来验证API密钥是否有效:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
故障排除:无效的应用名称
- 请确保您的URL路径以
google-meet开头。例如:
- 正确示例:
https://gateway.maton.ai/google-meet/v2/spaces - 错误示例:
https://gateway.maton.ai/meet/v2/spaces
资源
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~