|
通过 Microsoft Graph 使用托管 OAuth 认证访问 Microsoft Teams API。管理团队、频道、消息、会议,并访问录制和转录内容。
bash
https://gateway.maton.ai/microsoft-teams/{native-api-path}
将 {native-api-path} 替换为实际的 Microsoft Graph API 端点路径。网关将请求代理到 graph.microsoft.com 并自动注入您的 OAuth 令牌。
所有请求都需要在 Authorization 头中携带 Maton API 密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的 API 密钥设置为 MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的 Microsoft Teams OAuth 连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=microsoft-teams&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: microsoft-teams}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
connection: {
connection_id: fb0fdc4a-0b5a-40cf-8b92-3bdae848cde3,
status: ACTIVE,
creation_time: 2026-02-17T09:51:21.074601Z,
lastupdatedtime: 2026-02-17T09:51:34.323814Z,
url: https://connect.maton.ai/?session_token=...,
app: microsoft-teams,
metadata: {}
}
}
在浏览器中打开返回的 url 以完成 OAuth 授权。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果您有多个 Microsoft Teams 连接,请使用 Maton-Connection 头指定要使用的连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, fb0fdc4a-0b5a-40cf-8b92-3bdae848cde3)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最旧)的活动连接。
bash
GET /microsoft-teams/v1.0/me/joinedTeams
响应:
json
{
@odata.context: https://graph.microsoft.com/v1.0/$metadata#teams,
@odata.count: 1,
value: [
{
id: b643f103-870d-4f98-a23d-e6f164fae33e,
displayName: carvedai.com,
description: null,
isArchived: false,
tenantId: cb83c3f9-6d16-4cf3-bd8c-ab16b37932f9
}
]
}
bash
GET /microsoft-teams/v1.0/teams/{team-id}
bash
GET /microsoft-teams/v1.0/teams/{team-id}/channels
响应:
json
{
@odata.context: https://graph.microsoft.com/v1.0/$metadata#teams(...)/channels,
@odata.count: 1,
value: [
{
id: 19:9fwtZjo3IM0D8bLdQqR-_oMFw1eUDlzWjPfIhNGhVd41@thread.tacv2,
createdDateTime: 2026-02-16T20:09:27.254Z,
displayName: General,
description: null,
email: carvedai.com473@carvedai.com,
membershipType: standard,
isArchived: false
}
]
}
bash
GET /microsoft-teams/v1.0/teams/{team-id}/channels?$filter=membershipType eq private
bash
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
bash
POST /microsoft-teams/v1.0/teams/{team-id}/channels
Content-Type: application/json
{
displayName: New Channel,
description: Channel description,
membershipType: standard
}
响应:
json
{
id: 19:3b3361df822044558a062bb1a4ac8357@thread.tacv2,
createdDateTime: 2026-02-17T20:24:33.9284462Z,
displayName: Maton Test Channel,
description: Channel created by Maton integration test,
membershipType: standard,
isArchived: false
}
bash
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Content-Type: application/json
{
description: Updated description
}
成功时返回 204 No Content。注意:默认的“General”频道无法更新。
bash
DELETE /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
成功时返回 204 No Content。
bash
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/members
响应:
json
{
@odata.count: 1,
value: [
{
@odata.type: #microsoft.graph.aadUserConversationMember,
id: MCMjMiMj...,
roles: [owner],
displayName: Kevin Kim,
userId: 5f56d55b-2ffb-448d-982a-b52547431f71,
email: richard@carvedai.com
}
]
}
bash
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
bash
POST /
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 microsoft-teams-1776420083 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 microsoft-teams-1776420083 技能
skillhub install microsoft-teams-1776420083
文件大小: 5.96 KB | 发布时间: 2026-4-17 18:10