Teams 代理事件参考

使用此参考查找 Teams 代理活动的处理程序注册语法。 有关简介,请参阅 活动和处理程序。

独立于语言的 对话更新 和 安装更新 部分描述了事件范围和有效负载字段。 事件有效负载示例 适用于所有 SDK 语言。

调用处理程序可以要求对 Teams 做出响应。 调用示例引发未实现的异常,而不是在没有实现的情况下返回成功响应。 在使用这些处理程序之前,请先将异常替换为相应的响应。

事件参考

核心活动处理程序

此类 App 公开用于注册处理程序的扩展方法。 用于流畅链接的方法返回 App 。

事件 扩展方法 说明
收到的任何活动类型 OnActivity(handler) 为每个活动调用的 Catch-all 处理程序。
收到的消息活动 OnMessage(handler) 处理传入文本消息。 将正则表达式字符串作为模式匹配的第一个参数传递。
已接收对话更新 OnConversationUpdate(handler) 原始对话更新活动。
非代理成员加入 OnMembersAdded(handler) 触发时间 MembersAdded.Length > 0。
非代理成员离开 OnMembersRemoved(handler) 触发时间 MembersRemoved.Length > 0。
已添加安装 OnInstall(handler) 代理已安装。

特定于 Teams 的活动处理程序

事件 扩展方法 说明
已创建频道 OnChannelCreated(handler) 创建了 Teams 频道。
已删除频道 OnChannelDeleted(handler) 已删除 Teams 频道。
已重命名频道 OnChannelRenamed(handler) 重命名了 Teams 频道。
已重命名团队 OnTeamRenamed(handler) 该团队已更名。
已编辑消息 OnMessageUpdate(handler) 已编辑消息。
软删除的消息 OnMessageDelete(handler) 已软删除一封邮件。

Teams 调用活动

调用类型 扩展方法 说明
CardAction.Invoke OnExecuteAction(handler) 收到卡片操作调用活动。
task/fetch OnTaskFetch(handler) 已提取任务模块) (对话框。
task/submit OnTaskSubmit(handler) 已提交任务模块) (对话框。
fileConsent/invoke OnFileConsent(handler) 收到文件同意卡活动。
signin/verifyState 由 SDK 自动处理 (OAuth 流) 登录验证状态活动。

核心活动处理程序

支持的 app.on() 事件名称列表包括:

事件 事件名称字符串 说明
收到的任何活动类型 'activity' 为每个活动调用的 Catch-all 处理程序。
收到的消息活动 'message' 处理传入文本消息。 用于 app.message(pattern, handler) 正则表达式匹配。
已接收对话更新 'conversationUpdate' 原始对话更新活动。
已添加安装 'install.add' 代理已安装。
已删除安装 'install.remove' 代理已卸载。
已添加成员。 'membersAdded' 一个或多个成员加入了对话。
已删除成员 'membersRemoved' 一个或多个成员离开了对话。
已编辑消息 'messageUpdate' 已编辑对话中的消息。
软删除的消息 'messageDelete' ) (activity.channelData.eventType === 'softDeleteMessage' 软删除了一封邮件。
已收到已读回执 'readReceipt' 已收到已读回执。

特定于 Teams 的事件处理程序

app.on() 支持以下 Teams 特定的事件名称字符串:

事件 事件名称字符串 说明
channelCreated 'channelCreated' 创建了 Teams 频道。
channelDeleted 'channelDeleted' 已删除 Teams 频道。
channelRenamed 'channelRenamed' 重命名了 Teams 频道。
channelRestored 'channelRestored' 已恢复 Teams 频道。
channelMemberAdded 'channelMemberAdded' 已向频道添加成员。
channelMemberRemoved 'channelMemberRemoved' 成员已从频道中删除。
teamRenamed 'teamRenamed' 该团队已更名。
teamArchived 'teamArchived' 团队已存档。
teamDeleted 'teamDeleted' 已删除该团队。
teamRestored 'teamRestored' 该团队已恢复。
会议开始 'meetingStart' 会议已开始。
会议结束 'meetingEnd' 会议已结束。
参与者已加入 'meetingParticipantJoin' 参与者加入了会议。
参与者左侧 'meetingParticipantLeave' 参与者离开了会议。

Teams 调用活动

下表列出了可通过以下方式提供的 app.on()调用活动处理程序:

调用类型 事件名称字符串 说明
CardAction.Invoke 'card.action' ) (adaptiveCard/action 收到了一个卡操作调用活动。
signin/verifyState 由 SDK 自动处理 (OAuth 流) 登录验证状态活动。
task/fetch 'dialog.open' 已提取任务模块) (对话框。
task/submit 'dialog.submit' 已提交任务模块) (对话框。

核心活动处理程序

此类 App 公开装饰器样式处理程序注册。

事件 装饰器 说明
收到的任何活动 @app.on_activity 每个活动的 Catch-all 处理程序。
已接收消息 @app.on_message 处理传入文本消息。
带有模式的消息 @app.on_message_pattern(re.compile(...)) 处理与正则表达式模式匹配的消息。
对话更新 @app.on_conversation_update 原始对话更新;check members_added / members_removed.
已添加安装 @app.on_install_add 代理已安装。
已删除安装 @app.on_install_remove 代理已卸载。

特定于 Teams 的活动处理程序

事件 装饰器 说明
已创建频道 @app.on_channel_created 创建了 Teams 频道。
已删除频道 @app.on_channel_deleted 已删除 Teams 频道。
已重命名频道 @app.on_channel_renamed 重命名了 Teams 频道。
已重命名团队 @app.on_team_renamed 该团队已更名。
已编辑消息 @app.on_edit_message 已编辑消息。
软删除的消息 @app.on_soft_delete_message 已软删除一封邮件。
取消删除的邮件 @app.on_undelete_message 已删除的邮件已还原。
会议开始 @app.on_meeting_start 会议已开始。
会议结束 @app.on_meeting_end 会议已结束。
参与者已加入 @app.on_meeting_participant_join 参与者加入了会议。
参与者左侧 @app.on_meeting_participant_leave 参与者离开了会议。

Teams 调用活动

调用类型 装饰器 说明
CardAction.Invoke @app.on_card_action 收到卡片操作调用活动。
task/fetch @app.on_dialog_open 已提取任务模块) (对话框。
task/submit @app.on_dialog_submit 已提交任务模块) (对话框。
fileConsent/invoke @app.on_file_consent 收到文件同意卡活动。
signin/verifyState 由 SDK 自动处理 (OAuth 流) 登录验证状态活动。

消息反应活动

每个反应都有一个type值,例如 angry、 、 likesadheartlaugh、 或 。surprised 有效负载不包括原始消息内容,因此,如果您的代理需要这些内容来处理反应,请在发送消息时存储消息。 有效负载还可以包含中较旧的消息标识符 legacy.replyToId。 查看 添加 和 删除 的反应有效负载示例。

用于 OnMessageReaction 处理这两个更改。 读取 context.Activity.ReactionsAdded 和 context.Activity.ReactionsRemoved 用于反应,以及 context.Activity.ReplyToId 消息 ID。

teams.OnMessageReaction(async (context, cancellationToken) =>
{

});

Teams SDK 还专门为 OnMessageReactionAdded 和 OnMessageReactionRemoved提供单独的处理程序。 实现通用处理程序或特定处理程序,而不是两者兼而有之。 下面的示例说明了使用特定的处理程序来记录每个添加或删除的反应类型。

teams.OnMessageReactionAdded(async (context, cancellationToken) =>
{
    foreach (var reaction in context.Activity.ReactionsAdded ?? [])
    {
        Console.WriteLine($"User added reaction: {reaction.Type}");
    }
});

teams.OnMessageReactionRemoved(async (context, cancellationToken) =>
{
    foreach (var reaction in context.Activity.ReactionsRemoved ?? [])
    {
        Console.WriteLine($"User removed reaction: {reaction.Type}");
    }
});

使用事件处理 messageReaction 这两项更改。 读取 context.activity.reactionsAdded 和 context.activity.reactionsRemoved 用于反应,以及 context.activity.replyToId 消息 ID。

app.on('messageReaction', async (context) => {

});

以下示例在一个处理程序中处理添加和删除的反应,并记录每个反应的类型:

app.on('messageReaction', async ({ activity }) => {
  for (const reaction of activity.reactionsAdded ?? []) {
    console.log(`User added reaction: ${reaction.type}`);
  }

  for (const reaction of activity.reactionsRemoved ?? []) {
    console.log(`User removed reaction: ${reaction.type}`);
  }
});

使用 @app.on_message_reaction处理这两项更改。 读取 ctx.activity.reactions_added 和 ctx.activity.reactions_removed 用于反应,以及 ctx.activity.reply_to_id 消息 ID。

@app.on_message_reaction
async def handle_reaction(ctx: ActivityContext):
    pass

以下示例在一个处理程序中处理添加和删除的反应,并记录每个反应的类型:

@app.on_message_reaction
async def handle_reaction(ctx: ActivityContext[MessageReactionActivity]):
    for reaction in ctx.activity.reactions_added or []:
        print(f"User added reaction: {reaction.type}")

    for reaction in ctx.activity.reactions_removed or []:
        print(f"User removed reaction: {reaction.type}")

conversationUpdate 活动

conversationUpdate 活动用于表示 Teams 中的多种类型的事件。 可以通过检查不同的 conversationUpdate 事件的 channelData 属性来区分不同的事件。 在大多数情况下,这是不必要的,因为 Teams SDK 为每种类型都提供了专用的活动处理程序订阅。

对话更新活动有效负载具有 typeconversationUpdate的 。 频道和团队生命周期事件 channelData.eventType标识 . 成员身份更改还填充 membersAdded OR membersRemoved.

事件 有效负载事件类型或字段 范围 有效负载示例
已创建频道 channelData.eventType: channelCreated 团队 已创建频道
已重命名频道 channelData.eventType: channelRenamed 团队 已重命名频道
已删除频道 channelData.eventType: channelDeleted 团队 已删除频道
已还原频道 channelData.eventType: channelRestored 团队 已还原频道
已添加成员。 membersAdded;在团队中, channelData.eventTypeteamMemberAdded 全部 团队安装, 个人安装
已删除成员 membersRemoved;在团队中, channelData.eventTypeteamMemberRemoved 全部 已删除成员
已重命名团队 channelData.eventType: teamRenamed 团队 已重命名团队
已删除团队 channelData.eventType: teamDeleted 团队 已删除团队
已存档团队 channelData.eventType: teamArchived 团队 已存档团队
未存档团队 channelData.eventType: teamUnarchived 团队 未存档团队
已还原团队 channelData.eventType: teamRestored 团队 已还原团队

频道生命周期有效负载包括 中的 channelData.channel 频道 ID 和名称以及 中的团队 ID channelData.team。 团队生命周期有效负载包括团队的 ID 和名称,位于 channelData.team. 使用这些字段标识受影响的频道或团队,并在适当时通知用户有关更改的信息。

Azure 通信服务客户端加入或离开 Teams 会议不会触发对话更新活动。

成员更改

当安装代理或用户加入安装代理的对话时,将发生成员添加的事件。 当代理被卸载、用户离开或用户从租户中永久删除时,将发生成员删除事件。

这些事件可以描述代理本身或其他用户。 比较每个成员的 id in membersAdded 或 membersRemoved , recipient.id 以确定事件是否与代理有关。 代理的 ID 格式 28:<MicrosoftAppId>为 。

在团队上下文中,成员添加的事件使用 channelData.eventTypeteamMemberAdded,而成员删除的事件使用 teamMemberRemoved。

这些有效负载中的用户 ID 对于代理来说是唯一的。 将来进行交互(例如直接向用户发送消息)时缓存它们。 删除代理后,根据应用的数据保留要求为团队清除缓存数据。

在团队中安装代理时, conversation.id 标识用户在安装过程中选择的通道或启动安装的通道。 它不一定是常规频道。 对于代理安装和删除工作流,首选 安装更新事件。

安装更新事件详细信息

当在对话线程中安装代理或从对话线程中卸载代理时,Teams typeinstallationUpdate 将发送活动。 使用安装更新可以在安装代理安装时发送介绍性消息,并在卸载时清理用户或会话线程数据。 这有助于应用满足隐私和数据保留要求。

检查 action 以确定更改。

操作 含义
add 代理已安装在对话线程中。
remove 代理已从对话线程中卸载。
add-upgrade 应用升级将代理添加到清单。
remove-upgrade 应用升级从清单中删除了代理。

升级应用后,仅当升级在清单中添加或删除代理时,Teams 才会发送此事件。 其他应用升级不会触发安装更新事件。

安装更新事件

在团队中安装代理时, conversation.id 对话更新和安装更新活动都标识在安装期间选择的通道或进行安装的通道。 将欢迎消息发送到此频道,用户希望代理在其中运行。 如果明确需要常规频道 ID,请使用channelData.team.id

安装有效负载还显示 channelData.settings.selectedChannel.id、 channelData.channel、 channelData.team、租户信息和安装源。

下面的示例演示了在 Daves 演示团队的响应通道中的安装。 这两个活动都标识响应通道:

显示在所选响应通道中安装代理的动画。

注意

仅当应用安装到团队中时,才会对事件设置所 installationUpdateadd 选频道 ID。 在关联的团队安装对话中,更新有效负载, conversation.id 并 channelData.settings.selectedChannel.id 标识所选频道。

使用代理进行个人应用的卸载行为

卸载应用时,其代理也将卸载。 如果用户尝试向应用发送消息,他们会收到 403 响应,而代理在尝试发布新消息时会收到 403 响应。

个人作用域遵循与团队和群组聊天作用域相同的卸载后行为:卸载应用后,代理无法发送或接收消息。

显示卸载代理后禁止响应的屏幕截图。

安装和卸载事件的事件处理

Teams 可以随时添加新事件,因此请将代理设计为接受它无法识别的事件。 默认情况下,Teams SDK 响应 200 OK 你尚未为其注册处理程序的事件。

如果在没有 Teams SDK 的情况下生成代理或自定义 SDK 的默认事件处理,请保留此行为以应对意外事件。 否则,新安装、卸载或其他事件可能会导致代理中出现异常。

处理对话事件中的错误

不要发送缺乏对话上下文的错误消息。 以下屏幕截图显示了一个无帮助的错误响应:

屏幕截图显示了代理对话中没有有意义上下文的错误消息。

在开发过程中,有意义的诊断消息可以帮助解释特定错误。 在生产环境中,将错误和事件记录到 Azure 应用程序 Insights,而不是将调试详细信息发布到对话。 有关详细信息,请参阅 向机器人添加遥测。

事件有效负载示例

以下 JSON 示例显示独立于 SDK 语言的传入活动。 示例 ID 和时间戳仅供参考。

频道创建的有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:34:07.478Z",
    "localTimestamp": "2017-02-23T12:34:07.478-07:00",
    "id": "f:dd6ec311",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1wR7IdIRIoerMIWbewMi75JA3scaMuxvFon9eRQW2Nix5loMDo0362st2IaRVRirPZBv1WdXT8TIFWWmlQCizZQ"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterBot"
    },
    "channelData": {
        "channel": {
            "id": "19:6d97d816470f481dbcda38244b98689a@thread.skype",
            "name": "FunDiscussions"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "eventType": "channelCreated",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

频道重命名的有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:34:07.478Z",
    "localTimestamp": "2017-02-23T12:34:07.478-07:00",
    "id": "f:dd6ec311",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1wR7IdIRIoerMIWbewMi75JA3scaMuxvFon9eRQW2Nix5loMDo0362st2IaRVRirPZBv1WdXT8TIFWWmlQCizZQ"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterBot"
    },
    "channelData": {
        "channel": {
            "id": "19:6d97d816470f481dbcda38244b98689a@thread.skype",
            "name": "PhotographyUpdates"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "eventType": "channelRenamed",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

频道已删除有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:34:07.478Z",
    "localTimestamp": "2017-02-23T12:34:07.478-07:00",
    "id": "f:dd6ec311",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1wR7IdIRIoerMIWbewMi75JA3scaMuxvFon9eRQW2Nix5loMDo0362st2IaRVRirPZBv1WdXT8TIFWWmlQCizZQ"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterBot"
    },
    "channelData": {
        "channel": {
            "id": "19:6d97d816470f481dbcda38244b98689a@thread.skype",
            "name": "PhotographyUpdates"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "eventType": "channelDeleted",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

还原了有效负载的频道

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:34:07.478Z",
    "localTimestamp": "2017-02-23T12:34:07.478-07:00",
    "id": "f:dd6ec311",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1wR7IdIRIoerMIWbewMi75JA3scaMuxvFon9eRQW2Nix5loMDo0362st2IaRVRirPZBv1WdXT8TIFWWmlQCizZQ"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterBot"
    },
    "channelData": {
        "channel": {
            "id": "19:6d97d816470f481dbcda38244b98689a@thread.skype",
            "name": "FunDiscussions"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "eventType": "channelRestored",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

成员添加了团队安装有效负载

此示例显示将代理添加到团队时收到的活动。 conversation.id 并 channelData.settings.selectedChannel.id 标识在安装过程中选择的通道或触发安装的通道。

{
    "type": "conversationUpdate",
    "membersAdded": [
        {
            "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b"
        }
    ],
    "timestamp": "2021-12-07T22:34:56.534Z",
    "id": "f:0b9079f4-d4d3-3d8e-b883-798298053c7e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer/",
    "from": {
        "id": "29:1ljv6N86roXr5pjPrCJVIz6xHh5QxjI....",
        "aadObjectId": "eddfa9d4-346e-4cce-a18f-fa6261ad776b"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "tenantId": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f",
        "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2",
        "name": "2021 Test Channel"
    },
    "recipient": {
        "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b",
        "name": "Test Agent"
    },
    "channelData": {
        "settings": {
            "selectedChannel": {
                "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
            }
        },
        "team": {
            "aadGroupId": "f3ec8cd2-e704-4344-8c47-9a3a21d683c0",
            "name": "TestTeam2022",
            "id": "19:zFLSDFWsesfzcmKArqKJ-65aOXJz@sgf462H2wz41@thread.tacv2"
        },
        "tenant": {
            "id": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
        },
        "source": {
            "name": "message"
        }
    },
    "action": "add"
}

成员添加了个人安装有效负载

此示例显示了将代理添加到一对一聊天时收到的活动。

{
    "membersAdded": [
        {
            "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0"
        },
        {
            "id": "29:<userID>",
            "aadObjectId": "***"
        }
    ],
    "type": "conversationUpdate",
    "timestamp": "2019-04-23T10:17:44.349Z",
    "id": "f:5f85c2ad",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:<USERID>",
        "aadObjectId": "***"
    },
    "conversation": {
        "conversationType": "personal",
        "id": "***"
    },
    "recipient": {
        "id": "28:<BOT ID>",
        "name": "<BOT NAME>"
    },
    "channelData": {
        "tenant": {
            "id": "<TENANT ID>"
        }
    }
}

成员删除的有效负载

此示例描述团队 channelData 成员身份更改,而不是群组聊天或新的一对一对话。

{
    "membersRemoved": [
        {
            "id": "29:1_LCi5Up14pAy65yZuaJzG1uIT7ujYhjjSTsUNqjORsZHjLHKiQIBJa4cX2XsAsRoaY7va2w6ZymA9-1VtSY_g"
        }
    ],
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:37:06.96Z",
    "localTimestamp": "2017-02-23T12:37:06.96-07:00",
    "id": "f:d8a6a4aa",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0OIy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterAgent"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "eventType": "teamMemberRemoved",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

团队重命名有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:35:56.825Z",
    "localTimestamp": "2017-02-23T12:35:56.825-07:00",
    "id": "f:1406033e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
            "name": "New Team Name"
        },
        "eventType": "teamRenamed",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

团队删除的有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:35:56.825Z",
    "localTimestamp": "2017-02-23T12:35:56.825-07:00",
    "id": "f:1406033e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
            "name": "Team Name"
        },
        "eventType": "teamDeleted",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

团队还原的有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:35:56.825Z",
    "localTimestamp": "2017-02-23T12:35:56.825-07:00",
    "id": "f:1406033e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
            "name": "Team Name"
        },
        "eventType": "teamRestored",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

团队存档的有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:35:56.825Z",
    "localTimestamp": "2017-02-23T12:35:56.825-07:00",
    "id": "f:1406033e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
            "name": "Team Name"
        },
        "eventType": "teamArchived",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

团队未存档有效负载

{
    "type": "conversationUpdate",
    "timestamp": "2017-02-23T19:35:56.825Z",
    "localTimestamp": "2017-02-23T12:35:56.825-07:00",
    "id": "f:1406033e",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
            "name": "Team Name"
        },
        "eventType": "teamUnarchived",
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    }
}

已添加回应 有效负载

{
    "reactionsAdded": [
        {
            "type": "like"
        }
    ],
    "type": "messageReaction",
    "timestamp": "2017-10-16T18:45:41.943Z",
    "id": "f:9f78d1f3",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA",
        "aadObjectId": "c33aafc4-646d-4543-9d4c-abd28e4d2110"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "channel": {
            "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    },
    "replyToId": "1575667808184",
    "legacy": {
        "replyToId": "1:19uJ8TZA1cZcms7-2HLOW3pWRF4nSWEoVnRqc0DPa_kY"
    }
}

已删除回应的有效负载

{
    "reactionsRemoved": [
        {
            "type": "like"
        }
    ],
    "type": "messageReaction",
    "timestamp": "2017-10-16T18:45:41.943Z",
    "id": "f:9f78d1f3",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA",
        "aadObjectId": "c33aafc4-646d-4543-9d4c-abd28e4d2110"
    },
    "conversation": {
        "isGroup": true,
        "conversationType": "channel",
        "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "channel": {
            "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    },
    "replyToId": "1575667808184",
    "legacy": {
        "replyToId": "1:19uJ8TZA1cZcms7-2HLOW3pWRF4nSWEoVnRqc0DPa_kY"
    }
}

安装更新有效负载

{
    "type": "installationUpdate",
    "id": "f:816eb23d-bfa1-afa3-dfeb-d2aa338e9541",
    "timestamp": "2021-11-09T04:47:30.91Z",
    "serviceUrl": "https://smba.trafficmanager.net/amer/",
    "channelId": "msteams",
    "from": {
        "id": "29:1ljv6N86roXr5pjPrCJVIz6xHh5QxjI....",
        "aadObjectId": "eddfa9d4-346e-4cce-a18f-fa6261ad776b"
    },
    "recipient": {
        "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b",
        "name": "Test Agent"
    },
    "locale": "en-US",
    "entities": [
        {
            "type": "clientInfo",
            "locale": "en-US"
        }
    ],
    "conversation": {
        "isGroup": true,
        "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2",
        "name": "2021 Test Channel",
        "conversationType": "channel",
        "tenantId": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
    },
    "channelData": {
        "settings": {
            "selectedChannel": {
                "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
            }
        },
        "channel": {
            "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
        },
        "team": {
            "aadGroupId": "da849743-4259-475f-ae7a-4f4b0fb49943",
            "name": "TestTeam2022",
            "id": "19:zFLSDFWsesfzcmKArqKJ-65aOXJz@sgf462H2wz41@thread.tacv2"
        },
        "tenant": {
            "id": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
        },
        "source": {
            "name": "message"
        }
    },
    "action": "add"
}