Forum Discussion
Send Messages using Bot/Change Notification in MS Teams
salmannaeem17 - You can use Graph API for this Send chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft Learn. This requires team id, channel id and message id. Please note that this send messages works with only delegated permissions.
You can also refer this doc to send messages via bot using Rest API - Channel/Group Chat Bot Conversations - Teams | Microsoft Learn. But this may not suit your requirement as it needs conversation id and activity id.
Hi,
Thanks for your reply.
1) You mean this approach will not work? Can you tell me ways/examples to get conversation id, activity id etc.
2) What if I use 'bot' both for listening and sending messages. Can I achieve my task like this? Do I need IDs for this approach too?
3) Is there any other approach to achieve my task which I explained above?
Thanks
- salmannaeem17Nov 14, 2024Copper Contributor
Hi,
Meghana-MSFTAny update?Secondly If I want to use only bot for my listening and sending messages, how can I do it? Is it possible?
Thanks- Meghana-MSFTDec 10, 2024Former Employee
You cannot use bot for listening to messages. To listen to messages, you should subscribe to Microsoft Graph’s change notifications API. Graph API would be suitable option for you. You can send messages using the information you retrieve through the change notifications API.
- salmannaeem17Dec 16, 2024Copper Contributor
Hi,
I have achieved the above mentioned task by following the links below. I guess we may not have sync somewhere.https://learn.microsoft.com/en-us/microsoftteams/platform/sbs-teams-conversation-bot?tabs=dev
Additionally we need to add some RSC Permissions to the manifest.jsin to get messages without the bot being mentioned.
Thanks