Forbidden Message: Application with AAD App Id '{AAD App Id}' is not authorized to generate notifications about '{entityUrl}' to the recipient. Ensure that the expected Teams app is installed in the target scope (user, team, or chat)

Shuo Qiu (Wicresoft) 1 Reputation point Microsoft Vendor
2022-12-13T04:30:09+00:00

I got an error when I tried to send teams activity notification to a user in a team.

The API is POST /teams/{teamId}/sendActivityNotification

The error message said Forbidden Message: Application with AAD App Id '{AAD App Id}' is not authorized to generate notifications about '{entityUrl}' to the recipient. Ensure that the expected Teams app is installed in the target scope (user, team, or chat).

But I do have installed the app for the team that the recipient at before I sent notification. And I have been granted TeamsActivity.Send permission by Microsoft.

However, if the recipients uploaded the app package to their personal space (Apps -> Manage your apps -> Upload an app -> Upload a custom app), then they can successfully receive the activity notification though the API I used is POST /teams/{teamId}/sendActivityNotification. That doesn't make sense. It should check whether the app is installed in the team scope rather than user scope.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,714 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.
2,886 questions
{count} votes