Microsoft Graph DELETE subscription request fails - microsoft-graph-api

I accidentally let my subscriptions expire last night. When I sat down at work this morning, graph notifications were not flowing into my application and GET https://graph.microsoft.com/v1.0/subscriptions/ returned no subscriptions. I created new subscriptions successfully, but am still not receiving notifications from Graph.
So, I am trying to cleanup the subscriptions I created this morning to troubleshoot. In doing so I reached a subscription that results in an error when deleting.
I first request GET https://graph.microsoft.com/v1.0/subscriptions/ to retrieve a list of active subscriptions. From that response, I get the id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
I then send a request to DELETE https://graph.microsoft.com/v1.0/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
This returns the following response
404 NOT FOUND
{
"error": {
"code": "ExtensionError",
"message": "Operation: Delete; Exception: [Status Code: NotFound; Reason: Not Found]",
"innerError": {
"request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"date": "2018-12-13T20:36:36"
}
}
}
In my research into this error, I came across this SO question: Deleting Microsoft graph fails with ExtensionError
The answer suggests that my subscription has been orphaned. Could this have been the original problem with the original expired subscriptions?
Any advice or experience in this matter?

Webhooks had an issue going on when notifications were delayed on 12/17 between 5:20am PST and 8am PST. If you are still having issues, can you please share the requestId and timestamp from the failed requests so we can investigate further. Thanks.

Related

Microsoft Graph - App is unauthorized to create Sharepoint List subscription

I struggle to make app with ClientCredential auth flow to create subscription on SharePoint List.
Request:
var subscription = new Subscription
{
ChangeType = "updated",
NotificationUrl = "{validNotificationUrl}",
Resource = "sites/root/lists/{listId}",
ExpirationDateTime = DateTime.UtcNow.AddDays(2),
ClientState = "{clientState}"
};
subscription = await _graphClient.Subscriptions.Request().AddAsync(subscription);
Response:
Unauthorized 403
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Access denied. You do not have permission to perform this action or access this resource.]",
"innerError": {
"date": "2020-08-04T13:01:27",
"request-id": "c480fa5d-4bbd-44a1-9f86-587548a29a19"
}
}
I've checked request access_token, and it has required permissions (Sites.ReadWrite.All, Sites.Manage.All according to documentation should be enough).
Reading Subscriptions and creating lists works fine for app.
I started to play around with different configurations, trying to isolate the problem, and managed to:
make app create subscription on users resource.
make delegated user create subscription on list
I feel quite lost, since I've given app more permissions than delegated user, and it still gets Unauthorized 403, and response error doesn't tell much how to resolve this issue.
Are there any configurations for SharePoint List subscriptions that need to be taken care of for app authentication only?
The service is currently experiencing an issue where app-only lists and drive subscriptions are getting an access denied when it shouldn't. The team is currently working to solve the issue. I suggest you follow this issue as we investigate the problem or that you open a support ticket asking to link your ticket to the ICM 200246697.

MS GraphAPI Support for notifications/subscription on Exchange RoomMailBox in delegated mode

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.

Ambiguous ErrorQuotaExceeded message when using Microsoft Graph REST APIs

My current team has developed an application that interfaces with Microsoft Graph APIs in order to interact with Outlook emails from our enterprise portal.
Ultimately the REST API's has returned an unexpected amount of errors to multiple users, mentioning "ErrorQuotaExceeded" as the error code.
That's an extremely ambiguous message since none of the involved users has space quota issues. Also, this error only appears when calling some specific REST endpoints.
For instance, the following request always works, returning a payload with HTTP 200 response status, as expected:
GET https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages
However, if we try to synchronize the user emails adding /delta to the aforementioned GET request (as mentioned by the official docs), we get the following error, with HTTP 403 status code:
GET https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages/delta
{
"error": {
"code": "ErrorQuotaExceeded",
"message": "Mailbox has exceeded maximum mailbox size.",
"innerError": {
"request-id": "13c686c6-5d4d-4a9b-8594-3b34482d6805",
"date": "2018-11-13T08:09:12"
}
}
}
It should be noted that I have 3.27GB occupied out of 50GB, so it wouldn't make any sense to me that the ErrorQuotaExceeded error gets triggered.
The official Microsoft Graph Support page explicitly recommends asking this kind of questions to StackOverflow, since they don't seem to offer an official support to their API. Thanks in advance for your help.

microsoft-graph - Error: ResourceNotFound - Message: Resource could not be discovered

I've created a web app with Microsoft Graph API and it has been completed/tested and everything is working as expected. This web app is aimed to create calendar events for our Office 365 users. Right now there are a total of 9 users that calendar events are created for and two of them are having issues.
This is the specific response I get from Microsoft Graph API if I'm creating a calendar event for a user that is having issues:
Message:
{
"error": {
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"innerError": {
"request-id": "4d6efba0-fce2-4abe-9f60-be3df8b55d6f",
"date": "2018-08-29T15:26:58"
}
}
}
I know that everything I'm doing is correct as the other seven users have no issues so the issue must be with the office 365 account its self. I've looked into account settings/permissions and everything I've checked is identical to a user that is working.
One of the biggest issues I'm facing with this problem is I don't understand the error its self. When it says "ResourceNotFound" my guess is that it's saying that it can't find the user account even though it does exist.
My question is what should be the next steps be in order to find a resolution? Should I see if I can recreate the mailboxes and transfer the email from the broken account to a new account? Or should I continue to try to find the root problem?

How to create an event into a group

I'm using Microsoft Graph API v1 with Administrator credentials via my software to create Events in a Group. However the response I get is a 403 with the following:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "c4754c79-5e3a-4f63-9f88-404100513796",
"date": "2018-07-11T10:11:27"
}
}
}
on a POST request to https://graph.microsoft.com/v1.0/groups/{idGroup}/events/
I have checked all rights provided to the app via Azure AD and everything is fine (tokens, code and scope with Group.Read.All Group.ReadWrite.All). The Group is also created, the users are added to it and the owner is the admin I use for the create request.
I have also tried on the Microsoft Graph API Explorer but i have the same error.
Yesterday morning the creation was possible but I think some rights were corrupted. Is anybody has got this problem before? How to fix it?
After a few days without any changes in the code the problem dissapeared.
I am still not sure of what happened, anyway thanks guys !

Resources