1

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/myemail@company.nl/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.

Kaptein Babbalas
  • 1,058
  • 12
  • 15

1 Answers1

1

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/myemail@company.nl/mailFolders('inbox')/messages

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

Hope this helps.

Cuong Pham
  • 63
  • 4
  • Is there a way to query all the subscriptions tied to a specific mailbox? I cannot find anything like this in the documentation. – Kaptein Babbalas Oct 26 '16 at 09:13
  • No, it is not supported by the API at the moment. You can only query for a specific subscription using subscription id. – Cuong Pham Oct 26 '16 at 17:52
  • @CuongPham I am getting the same error. I did not understand the solution. I have posted my issue here https://github.com/microsoftgraph/nodejs-webhooks-rest-sample/issues/17. The error is in creating the subscription. Can you please help me. Thanks in advance. – Kapil Yadav Jun 19 '18 at 06:44
  • I'm having the same error trying to subscribe to "created" notification on contacts folder. While "updated,deleted" works properly. – norekhov Sep 03 '18 at 13:54