question

NirajSinha-2529 avatar image
0 Votes"
NirajSinha-2529 asked NirajSinha-2529 commented

Using Graph Explorer to send teams notification to specific user.


I am getting Forbidden Response.

{
"error": {
"code": "Forbidden",
"message": "Application with AAD App Id 'de8bc8b5-d9f9-48b1-a8ad-b748da725064' is not authorized to generate notifications about 'https://graph.microsoft.com/v1.0/teams/b7b340ba-1495-4b3a-92ed-f337a1ba59a2' to the recipient. Ensure that the expected Teams app is installed in the target scope (user, team, or chat).",
"innerError": {
"date": "2021-08-04T04:53:06",
"request-id": "650c8528-d24e-4f01-a99d-125bb551806b",
"client-request-id": "dcb59e6e-c24b-b3fc-eeb7-c3bf36744bb3"
}
}
}

I have the right permission scope i.e TeamsActivity.Send. It is complaining for Graph Explorer app id is not authorized.
"app_displayname": "Graph Explorer",
"appid": "de8bc8b5-d9f9-48b1-a8ad-b748da725064",

Can we use graph explorer to send notifications to teams for testing?


office-teams-app-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PrithviKamble-MSFT-9239 avatar image
0 Votes"
PrithviKamble-MSFT-9239 answered NirajSinha-2529 commented

Hi, can you confirm once the Azure app id you are using for your app is same as the app id you are getting in the error response. If yes, check once if the app is installed in target scope (in teams or group chat) form where you are trying to send the notification.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am not using any app to send notification, I am using graph explorer to send Notification.


message": "Application with AAD App Id 'de8bc8b5-d9f9-48b1-a8ad-b748da725064' is not authorized to generate notifications about

This App Id is of Graph Explorer. Verified by decoding access token. which I got in response.
"app_displayname": "Graph Explorer",
"appid": "de8bc8b5-d9f9-48b1-a8ad-b748da725064",

I am using graph explorer to send notifications to teams. I am getting the same error for sending any kind of notifications for teams.

I



0 Votes 0 ·

-Hello,
Could you please create a new app and install the app in relevant scope (teams or group chat) to make the API work.
Also the API requires few application level permissions to work.
While testing it using Graph Explorer, it will create its own app id that is not related to actual app, that's why it is causing forbidden error. Could you please try to test your API using Postman tool.


Thanks!!

1 Vote 1 ·
NirajSinha-2529 avatar image NirajSinha-2529 PrithviKamble-MSFT-9239 ·

Thanks this help.
Was able to send notification using postman.

0 Votes 0 ·