没有 MS MS Graph 的 MS Teams API
MS Teams API without MS MS Graph
我想知道。有没有方法可以在触发某些事件的 MS 团队中创建自动聊天?
我假设 MS 团队中有一些 API,但我不知道它在哪里。
我得到了一些文章,为了满足我的要求,我们可以使用 MS 图表。但在我去购买 MS Graph 许可证之前。
有什么方法可以在没有 MS Graph 的情况下回答我的要求。
在 MS 团队中,有一个名为 'Create chat' 的 API 来创建一对一聊天或群聊。调用此 API 需要以下权限之一:
Delegated (work or school account): Chat.Create, Chat.ReadWrite
创建一对一聊天:
POST https://graph.microsoft.com/v1.0/chats
Content-Type: application/json
{
"chatType": "oneOnOne",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')"
}
]
}
创建群聊:
POST https://graph.microsoft.com/v1.0/chats
Content-Type: application/json
{
"chatType": "group",
"topic": "Group chat title",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('3626a173-f2bc-4883-bcf7-01514c3bfb82')"
}
]
}
有关详细信息,请参阅此文档:https://docs.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http
我想知道。有没有方法可以在触发某些事件的 MS 团队中创建自动聊天?
我假设 MS 团队中有一些 API,但我不知道它在哪里。
我得到了一些文章,为了满足我的要求,我们可以使用 MS 图表。但在我去购买 MS Graph 许可证之前。
有什么方法可以在没有 MS Graph 的情况下回答我的要求。
在 MS 团队中,有一个名为 'Create chat' 的 API 来创建一对一聊天或群聊。调用此 API 需要以下权限之一:
Delegated (work or school account): Chat.Create, Chat.ReadWrite
创建一对一聊天:
POST https://graph.microsoft.com/v1.0/chats
Content-Type: application/json
{
"chatType": "oneOnOne",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')"
}
]
}
创建群聊:
POST https://graph.microsoft.com/v1.0/chats
Content-Type: application/json
{
"chatType": "group",
"topic": "Group chat title",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('3626a173-f2bc-4883-bcf7-01514c3bfb82')"
}
]
}
有关详细信息,请参阅此文档:https://docs.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http