Forum Discussion
Notifications with sendActivityNotification API
Pratapkarn2186 - Have you try to test your API using Postman tool?
Sayali-MSFT: I tried with the postman and got an error.
API Request: https://graph.microsoft.com/v1.0/users/xxxxx/teamwork/sendActivityNotification
Response:
{
"error": {
"code": "Forbidden",
"message": "Application with AAD App Id 'xxxxxxx' is not authorized to generate custom text notifications about '/v1.0/users/xxxxx/teamwork/Microsoft.Teams.GraphSvc.sendActivityNotification' to the recipient. Ensure that the expected Teams app is installed in the target scope (user, team, or chat).",
"innerError": {
"date": "2022-09-27T07:59:00",
"request-id": "c52396c3-54cf-4050-b861-6ee5b102519c",
"client-request-id": "c52396c3-54cf-4050-b861-6ee5b102519c"
}
}
}
- Sayali-MSFTOct 03, 2022
Microsoft
Pratapkarn2186 -No need to assigning the app created to users. - Pratapkarn2186Oct 01, 2022Copper Contributor
- Sayali-MSFTSep 30, 2022
Microsoft
We tried with the manifest you shared it worked for us. Also included the request body you shared and changed team and user id's it also worked.
Can you try to change id in your manifest and see all old instances are deleted.
Also got the related thread -
https://stackoverflow.com/questions/66346794/application-with-aad-app-id-is-not-authorized-to-generate-notifications-about - Pratapkarn2186Sep 28, 2022Copper Contributor
Sayali-MSFT: Did you get a chance to look Manifest file. - Pratapkarn2186Sep 27, 2022Copper Contributor
- Pratapkarn2186Sep 27, 2022Copper Contributor
Please find the manifest file.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json",
"version": "1.0.1",
"manifestVersion": "1.14",
"id": "xxxxx-xxx-xxx-xxxx-vvvvvvvv",
"packageName": "com.package.name",
"name": {
"short": "Vavmex-500",
"full": ""
},
"developer": {
"name": "xxxx",
"mpnId": "",
"websiteUrl": "https://xxxxx.ai",
"privacyUrl": "https://xxxxx.ai",
"termsOfUseUrl": "https://xxxx.ai/t&c"
},
"description": {
"short": "Messaging App",
"full": "Application is used to send and receive messages"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"staticTabs": [
{
"entityId": "xxxxx-xxxx-xxxx-xxx-xxxxxxx",
"name": "MultiLine",
"contentUrl": "https://xxxxx.xxxxxx.net ",
"scopes": [
"personal"
]
},
{
"entityId": "about",
"scopes": [
"personal"
]
}
],
"validDomains": [
"xxxxx.xxxxx.net"
],
"webApplicationInfo": {
"id": "xxxxx-393c-xxxx-930b-xxxxxxxxx",
"resource": "api://xxxxxx.xxxxx.net/xxxxx-393c-47c5-xxxx-xxxxx"
},
"isFullScreen": true,
"activities": {
"activityTypes": [
{
"type": "notify",
"description": "Notification",
"templateText": "MultiLine"
}
]
}
}
- Sayali-MSFTSep 27, 2022
Microsoft
Pratapkarn2186-Could you please share the manifest json , So that we can try it from our end and let you know.