403 Forbidden - subCode MessageWritesBlocked

Behrouz Houshmandi 20 Reputation points Microsoft Employee
2024-01-26T17:29:02.7866667+00:00

RE: '403 response code with a subCode: 'MessageWritesBlocked' stated in the following excerpt taken from this page,   "As a developer, you can create a report to understand which users in your organization have blocked, muted, or uninstalled a bot. This information may help your organization's admins to broadcast org-wide messages or drive app usage. Using Teams, you can send a proactive message to the bot to verify if a user has blocked or uninstalled a bot. If the bot is blocked or uninstalled, Teams returns a 403 response code with a subCode: MessageWritesBlocked. This response indicates that the message sent by the bot isn't delivered to the user."   I have tested the following 3 scenarios and while I did get a 403 response in all cases, the error content was very different from what is mentioned above, and the responses did not contain a subCode, as seen below. Could you clarify please where I can find the subCode? Or is that deprectaed? FYI, I am using the latest veridon of Bot Framework and TeamsFx  

Scenario: bot removed from the target channel User's image

 Scenario: bot not installed in the one-on-one chat  User's image

Scenario: bot blocked by the user in the one-on-one chat  User's image

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,627 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,065 questions
{count} votes