0

member added & channel created event in Teams

I want to get the details like above, for example, adding member into one team OR creating new channel.

I try List Channel Messages API, but the response have no relative details, just some chat messages details:

List Channel Messages API: GET https://graph.microsoft.com/beta/teams/{group-id-for-teams}/channels/{channel-id}/messages

Is there method to achieve the needs, Thanks.

user9138870
  • 23
  • 2
  • 6

1 Answers1

1

There is currently no way to use MS Graph to subscribe to these events. You can however use a bot to subscribe and respond to them.

See: https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications

Andrew Clear
  • 7,910
  • 5
  • 27
  • 35
  • Thank you for your reply. The Channel ID is got from the bot event, and the bot event respond cannot meet my needs, because it don't include the channel creator OR member invitees. – user9138870 Oct 09 '19 at 03:19
  • @user9138870 I'm afraid it can't be done, then, at this time. You may find [this answer of mine](https://stackoverflow.com/a/55525014/10860086) to provide some additional context, although it doesn't directly relate to your question. – mdrichardson Oct 09 '19 at 17:25
  • @mdrichardson-MSFT Thanks. What is the messages pushed in Channel defined, likes somebody add someone in the team. Does MSFT have plan to develop relative API about it. – user9138870 Oct 11 '19 at 02:45
  • @mdrichardson-MSFT Another, I think 'WHO DO WHAT' is useful for Teams or Bots developer, but most WHO attribute can't match the logic. – user9138870 Oct 11 '19 at 02:47
  • @user9138870 I don't believe we plan to add it to the Bot Framework. I can't speak to the Graph API, although I can see that [it's currently not available](https://learn.microsoft.com/en-us/graph/api/resources/channel?view=graph-rest-1.0#json-representation). No messages get pushed to a bot at channel creation...the bot has to get manually installed to the channel after channel creation. Until then, the bot doesn't even know the channel exists. To get team members, you can [query the roster](https://stackoverflow.com/a/56942311/10860086)...the bot has to be in the channel though. – mdrichardson Oct 11 '19 at 17:24
  • If the bot is already installed in the team, it will receive a channel created event for new channels that are created. You could respond to this event by calling the correct API to retrieve the team roster, but it wouldn't be possible to retrieve the channel creator. See https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications – Andrew Clear Oct 11 '19 at 22:30