I have a background application and need to read outlook messages for user.
I created an application on https://apps.dev.microsoft.com after logging under this user.
I set the following permissions:
Then I try to create subscription:
where name of user in Resource property is the same as I logged to system when I had been creating application on https://apps.dev.microsoft.com
But I get
"Operation: Create; Exception: [Status Code: Unauthorized; Reason: No applicable user context claims found.]",
what is wrong?
Related
I want to create meeting event. I have added user in azure ad and also assigned delegated permission Calendars.ReadWrite.
But while creating event by following lines it throws error:
var response = await graphClient.Me.Calendar.Events.Request().AddAsync(#event);
Code: MailboxNotEnabledForRESTAPI
Message: The mailbox is either inactive, soft-deleted, or is hosted on-premise.
Here I found answer from Microsoft :
https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i.html
Issue Description :
Through the app, we send activity notifications to users feed., When we send activity in the same tenant, it works, But when activity is sent to an external tenant then it throws the below error from graph API
API used :
https://graph.microsoft.com/beta/teams/<team_id>/sendActivityNotification
where -> <team_id> is team id of external tenant
Error Message :
ERROR -> b'{"error":{"code":"Forbidden","message":"Sender of notification does not have access to the team 'fe51246f-1a2c-4af7-956f-7b124431bd31'.","innerError":{"date":"2021-10-21T09:43:55","request-id":"8c9b082c-40e6-4dea-999e-f60163060aa5","client-request-id":"8c9b082c-40e6-4dea-999e-f60163060aa5"}}}'
Please suggest ways to implement above.
I get this issue every time I try to create a subscription to get notified related to a team in Microsoft Teams.
Operation: Create; Exception: [Status Code: Unauthorized; Reason: Required permissions to access tenant-wide channel message subscription ('ChannelMessage.Read.All') is missing.]
The error is saying that it requires a tenant-wide channel message permission.
I have already included in the OAuth and also got the token with the scope details for access.
here are the details of the permission for which I'm having access to
I am not sure if something is missing here.
Moving my answer from comments !!
For Application Permission "Before calling this API with application permissions, you must request access for the same." Please Check here
In delegated API permission mode, we are able to get events () from RoomMailBox calendar but not subscribe for notifications (webhooks) on events changes.
Each time we tried to create notification channel (https://graph.microsoft.com/v1.0/subscriptions) we got an error :
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Access is denied. Check credentials and try again.]",
"innerError": {
"request-id": "XXXXXXXXXXXXXXXX",
"date": "XXXXXXXXXXXXX"
}
}
Moreover, we have full access on RoomMailBox by using user account we used on delegated mode (user account impersonated).
If we try it by using Application permission mode, it's working, we got a subscription channel. Everything is OK.
Could you tell if there is a way to subscribe RoomMailBox (actually it seems you just support UserMailbox & SharedMailBox) calendar events notifications in delegated API permission mode ?
It's a known limitation of create notification API currently.
Delegated user permissions are not allowed to create a subscription to a shared calendar.
Only application permissions (app-only) are possible.
If you need it to be provided, please submit a user voice request.
See a previous discussion here.
I would like to create a subscription for incoming mails on a shared mailbox with Microsoft graph.
Background:
I have an app created with delegated user rights:
Read all webhook subscriptions (preview)
Read and write user mailbox settings
Read and write user and shared mail
I have created a shared mail box
I have added a user to that shared mailbox.
I have added the shared mailbox to the users folders so I see users mailbox and the shared mailbox in the WEB GUI
I have created a c# program to receive auth token, created subscriptions and listed messages from a mailbox
What works:
Receiving auth token
List messages of users mail box
List messages of shared mailbox
Create subscription on users mail box
It does not work if I try to create a subscription for incoming mails
in the shared mail box.
My resource string during creation of the subscription is:
Resource = users/xx#xxx.onmicrosoft.com/mailFolders('Inbox')/messages
As said works well with the users mail address but fails using the shared mail box address:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]",
"innerError": {
"request-id": "xxxxx-8515-4048-8c05-f3eb91a1f69a",
"date": "2018-12-13T15:17:09"
}
}
}Subscription failed because:Forbidden
Did I use the wrong resource string here or did I miss an app right here?
according to
[Microsoft comunity][1]https://answers.microsoft.com/en-us/msoffice/forum/all/new-email-notification-for-shared-mailboxes/356cca22-6b23-440c-84a4-3a7b1c4021ad
this will never work
This is 'expected behavior' for shared mailboxes- you'd need to add it as an account, not a shared mailbox, to get notifications. You could use macros to watch the inbox and alert you when a new message arrived.