Kaptein Babbalas
Kaptein Babbalas

Reputation: 1108

Microsoft Graph Api Webhook subscription via Rest Api not working anymore

I have a working application that receive email webhook events from MS-Graph Api. I noticed that I could not find the subscription back using the subscriptionId, I get a 404 error.I also cannot delete the subscription using the id.

I investigated further and noticed that I cannot create new subscriptions anymore: The Application registered in Azure AD is a service-application (daemon)

My application auto renews the subscriptions and every time it did that I get a 202 response, but somehow the the subscription gets lost.

Request:

POST: https://graph.microsoft.com/beta/subscriptions

{ "changeType": "created,updated,deleted", "notificationUrl": "https://myapi.azurewebsites.net/GraphWebhook/Inbox", "resource": "Users/[email protected]/mailFolders('inbox')/messages", "expirationDateTime":"2016-10-25T20:23:45.9356913Z", "clientState": "subscription-identifier" }

Response:

"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]",
"innerError": {
  "request-id": "681ac550-be6f-4882-9b6b-e089c36ad38e",
  "date": "2016-10-25T10:13:25"
}

Does anyone have any ideas?

UPDATE: Working now again out of the blue.

Upvotes: 1

Views: 2322

Answers (1)

Cuong Pham
Cuong Pham

Reputation: 63

The API supports both user id and user email address as part of resource path and it DOES NOT change. To check whether it is API issue or resource issue, you could try to access your resource using graph explorer:

GET https://graph.microsoft.com/beta/users/[email protected]/mailFolders('inbox')/messages

Regarding the error you saw when creating subscription, it looks like an Exchange issue related to this.

Hope this helps.

Upvotes: 1

Related Questions