Forum Discussion
Microsoft.Bot.Connector SendToConversationAsync Failed - 'Forbidden'
So, the example shows retry mode.
But ... What is my mistake (code above, MessageActivity)?
Most of them are processed successfully, but some fails with 'Operation returned an invalid status code 'Forbidden'.
How can I handle it? What is the reason?
Also, I have a second question about "block bot conversation."
If the user blocks the conversation, I think SendToConversationAsync will fail, too. How can I handle this, and what kind of error will be raised?
- Sayali-MSFTMar 24, 2025
Microsoft
Could you please check your configurations and verify that your ServiceURL is still valid or changed.
The ServiceUrl in the ConversationReference can change. Always use the latest ServiceUrl provided in the incoming activity when responding to a user.
For further information on this please refer this sample:Microsoft-Teams-Samples/samples/bot-conversation/csharp/Bots/TeamsConversationBot.cs at main · OfficeDev/Microsoft-Teams-Samples (github.com)