Dec 26 2023 05:23 PM
I am trying to build a bot which will have a few message extension to submit data and then I will make a request to my custom backend. I want to save the data and want to send dm to the user.
I am planning to expose a route from my botbuilder restify server (built by teams toolkit) to send a dm to the user (from bot's account) because I could not find a way to send a dm without bot framework.
The only problem is when I am trying to send a dm I am getting an error saying "Bot is not installed in user's personal scope", which is true because the app is only installed in a team.
How can I tackle this problem? Basically I am building a feedback bot for companies so I want to proactively send dm message to all the employees and admins. What are different ways to do this thing.
Feel free to ask about any other information if you need, thanks!
Dec 26 2023 09:25 PM
SolutionDec 27 2023 12:16 AM
Dec 27 2023 12:41 AM - edited Dec 27 2023 12:42 AM
Actually, it depends on your requirement, but this is one of the correct approaches.
Please share your valuable feedback via Microsoft Teams Developer Feedback link.
Dec 27 2023 04:58 AM
Dec 27 2023 05:26 AM
@themashcodee2 - Yes, you can create a group chat in Microsoft Teams and invite a bot to it. Once the group chat is created, you can send messages to it, and the bot will be able to receive and respond to them.
Dec 27 2023 07:33 AM
@Prasad_Das-MSFTbut actually I am getting these errors when
1. creating a group chat with bot included in the members
2. inviting the bot later
btw I have these permission in my token
"https://graph.microsoft.com/Channel.ReadBasic.All https://graph.microsoft.com/Channel.Create https://graph.microsoft.com/Group.Read.All https://graph.microsoft.com/User.ReadBasic.All https://graph.microsoft.com/Organization.Read.All https://graph.microsoft.com/Chat.ReadWrite.All";
what api/way you would suggest to create a group chat with bot and then what would be the best ways to send message in that group chat?
Dec 27 2023 07:41 AM
Dec 27 2023 09:21 PM
@themashcodee2 - Could you please refer this document which explains how to create conversation with bot in group chat? Create conversation bots for channel or group chat - Teams | Microsoft Learn
Dec 27 2023 09:23 PM
@themashcodee2 - To send chatMessage in a channel or a chat using Graph API, you can follow this:
Send chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft LearnSend chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft Learn
Dec 27 2023 11:22 PM
Dec 28 2023 12:30 AM
Dec 28 2023 11:29 PM
@themashcodee2 - This API (Send chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft Learn), only works with delegated permissions. Delegated permissions should be used when you want the application to perform certain actions on behalf of a user. For example, allow application to access directory data as signed in user.
Application permissions are only supported for migration.
Dec 29 2023 12:38 AM
Dec 26 2023 09:25 PM
Solution