Search code examples
microsoft-graph-apibotframeworkmicrosoft-teams

Send Message to Users In Group


I have a group on azure, I have been able to get the members of the group using MS Graph API.

I have the details of the users in this format:

{
      '@odata.type': '#microsoft.graph.user',
      id: 'xxx-xxxxx-xxxxx',
      businessPhones: [],
      displayName: 'USER__FULL_NAME',
      givenName: 'USER_FIRST_NAME',
      jobTitle: null,
      mail: 'USER_EMAIL',
      mobilePhone: null,
      officeLocation: null,
      preferredLanguage: 'en-US',
      surname: 'USER_LAST_NAME',
      userPrincipalName: 'USER_EMAIL'
}

I want to send a message to the members of the group using BotFramework Node.js SDK.

I have checked Microsoft Bot Service Documentation, I can't find anything related


Solution

  • there are two approaches :

    1. Using pro-active messages via the bot's Teams Channel.
      https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet
    2. if you do not need/want a bot that there are options to 'just' start a new 1:1 or group-chat with a Graph call.
      https://learn.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-beta&tabs=http