Forum Discussion
Notifications for custom applications
- Aug 26, 2022
Based on the error it seems like the app is not installed in the Teams. Could you please follow this document and sample to set it up correctly.
https://docs.microsoft.com/en-us/graph/api/userteamwork-sendactivitynotification?view=graph-rest-1.0&tabs=http
2) Other way is to create a Incoming Webhooks but it allows external applications to share content in Microsoft Teams channels but not personally to specific person:
https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook
- Pratapkarn2186Aug 25, 2022Copper Contributor
Thanks, Chetan for your reply.
For using the sendactivitynotification we will need a user with O365 license.
Is there any alternate way where we will not need a licensed user ?- Meghana-MSFTAug 25, 2022Bronze Contributor
If you are using Teams then I think you already have O365 license.
Also, you need Azure Subscription to create Azure App registration with application permission to call the specific Graph API.- Pratapkarn2186Aug 26, 2022Copper Contributor
Hi,
I tried using sendActivityNotification API but got the below error every time.
Application with AAD App Id 'de8bc8b5-d9f9-48b1-a8ad-b748da725064' is not authorized to generate custom text notifications about '/v1.0/users/XXXX/teamwork/Microsoft.Teams.GraphSvc.sendActivityNotification' to the recipient. Ensure that the expected Teams app is installed in the target scope (user, team, or chat).The token which is generated has below scopes:
openid profile User.Read email TeamsActivity.Sendde8bc8b5-d9f9-48b1-a8ad-b748da725064 is the appid of the graph explorer, in my case I want API to be executed from an external system.
Let me know if I am missing anything and how to achieve it.