Get members from any type of a chat in Teams (personal, groupChat, or channel)?

久未见 提交于 2021-02-11 18:22:43

问题


I have a message extension app for MS TEAMS. This app will be preinstalled inside some organization. I should get members of any conversation type. There is a way via a graph https://graph.microsoft.com/v1.0/groups/{group-id-for-teams}/members. I use application permission here.

But it looks like I can get users only for "group" (a team is inside Teams), which has channels. I got 4 types of conversation type from ChannelAccount (namespace Microsoft.Bot.Schema):

  • personal
  • groupChat,
  • channel,
  • null

Also, there is bool isGroup property.

How can I get members of a specific chat, which can be any conversation type?


回答1:


You can use this set of endpoints to access both group chat and channel members. You don't technically need to get the "members" of a 1-1 chat, because it is only individual users (if you add a 3rd user, for instance, it will switch to becoming a group chat, I think). If you -do- want to get the -existence- of these 1-1 chats, you can use this endpoint. Note that these are both BETA endpoints, so some caveats apply.



来源:https://stackoverflow.com/questions/62777518/get-members-from-any-type-of-a-chat-in-teams-personal-groupchat-or-channel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!