我想知道。有沒有在觸發某些事件的 MS 團隊上創建自動聊天的方法?
我假設 MS 團隊有一些 API,但我不知道它在哪里。
我得到了一些文章,為了滿足我的要求,我們可以使用 MS 圖。但在我去購買 MS Graph 許可證之前。
沒有 MS Graph 有什么方法可以滿足我的要求。
uj5u.com熱心網友回復:
在 MS 團隊中,有一個名為“創建聊天”的 API 來創建一對一聊天或群聊。呼叫此 API 需要以下權限之一:
委派(作業或學校帳戶):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"],
"[email protected]": "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"[email protected]": "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"],
"[email protected]": "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"[email protected]": "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"[email protected]": "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
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/390884.html
標籤:C# asp.net-mvc 微软团队 网络接口 microsoft-graph-sdks
上一篇:如何使用時間跨度來倒計時分鐘?
下一篇:從控制器訪問ViewBag資料
