Forum Discussion
Euregan
May 09, 2025Copper Contributor
Getting a 401 when trying to create a conversation
Hello ! Using the node botbuilder SDK, I am trying to setup my bot to proactively create a conversation in a public channel on Teams. However, I keep getting 401 responses from the API, with no furt...
Euregan
May 12, 2025Copper Contributor
Thanks for the swift reply!
I have changed the MicrosoftAppTenantId to use process.env.MS_TENANT_ID instead, and I have added three of the four permissions (Chat.ReadWrite, Team.ReadBasic.All, Group.Read.All) as application permissions. However, I can not add ChannelMessage.Send, as it is only available in delegated permissions.
This has not solved my issue, as I still get the same 401 response, "Authorization has been denied for this request."
Nivedipa-MSFT
Microsoft
May 15, 2025@Euregan - You can't create a new conversation in a public Teams channel using only an application token.
If you need to send messages to a public channel, follow these steps:
- Use a delegated token (via user sign-in) with ChannelMessage.Send.
- Ensure the bot is installed in the team, and capture a conversation reference when it’s first mentioned or added.
- Use that reference with continueConversationAsync() to send messages later.