I've created some Subscriptions for certain inboxes many months ago, and system successfully received notifications about received emails, also subscriptions are regularly updated to increase expiration dates.
Here's the list of my subscriptions:
https://graph.microsoft.com/v1.0/subscriptions/
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "ef4d00ca-cf0c-4da6-bded-1ab47295e3f5",
"resource": "users/622eee14-9413-49e3-ac53-10148eba09be/messages",
"applicationId": "281e7aa8-7ef8-4a02-9195-83ffb149d95c",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://...",
"expirationDateTime": "2019-12-03T23:00:03.0238504Z",
"creatorId": "2ca67f35-32ba-4ef5-99ab-6686a93e0007"
},
{
"id": "6f056383-df34-47b5-aaf2-dce3fca1c511",
"resource": "users/3ccbd0c8-f11e-4bac-99df-27b78be74aaa/messages",
"applicationId": "281e7aa8-7ef8-4a02-9195-83ffb149d95c",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://...",
"expirationDateTime": "2019-12-03T23:00:01.4332477Z",
"creatorId": "2ca67f35-32ba-4ef5-99ab-6686a93e0007"
}
]
}
But starting today (2019-12-02) system stopped receiving notifications.
Then I've created subscription with my test account
subscription was created successfully,
calling https://graph.microsoft.com/v1.0/subscriptions/, I've received response
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "dfefbb04-887f-439f-bb09-a6075eeca8cd",
"resource": "users/ebaeb8ab-44c1-40e1-8725-635759c035db/messages",
"applicationId": "57afcb67-6089-4abc-bba8-2470ce9c22ec",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://63efa1ea.ngrok.io/api/Core/MailNotification/Listen",
"expirationDateTime": "2019-12-04T13:10:14.2380272Z",
"creatorId": "6a046ec1-ec01-43de-83b8-0e0696e89ecf"
}
]
}
I've tried sending email to mailbox, mentioned above, but still I receive no notifications.
Does something changed to Ms Graph? Is there a way to troubleshoot this problem, can I see some logs in azure portal or somewhere else, did MS Graph tried to send me a notification? Or it just suddenly stopped working?
It seems there was a degradation of service that affected Microsoft Graph Exchange services from 30th November '19. This seems to have been resolved as indicated from this comment.
This seems to be related to a current problem with Graph Subscriptions that I have as well. There is a Github Issue of this, with several reports of this problem.
Related
I'm looking through the Microsoft documentation on Subscription objects (https://learn.microsoft.com/en-us/graph/webhooks). I want to receive a notification for when a user changes their Profile Picture (photo property)
I sent the following subscription request, and I am successful in receiving notification when I update user properties, but not when I change their picture:
POST /v1.0/subscriptions HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer <TOKEN>
{
"changeType": "updated",
"notificationUrl": "https://00000.ngrok.io/listen",
"resource": "/users",
"expirationDateTime": "2020-12-09T11:00:00.0000000Z",
"clientState": "SecretClientState"
}
Response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "00000000-0000-0000-0000-000000000000",
"resource": "/users",
"applicationId": "00000000-0000-0000-0000-000000000000",
"changeType": "updated",
"clientState": "SecretClientState",
"notificationUrl": "https://00000.ngrok.io/listen",
"lifecycleNotificationUrl": null,
"expirationDateTime": "2020-12-09T11:00:00Z",
"creatorId": "00000000-0000-0000-0000-000000000000",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null
}
Is there a way to subscript to photo changes in the Microsoft Graph in aggregate? Or do I have to subscribe to each user individually?
Reading and updating a user's profile photo is only possible if the user has a mailbox. Additionally, any photos that may have been previously stored using the thumbnailPhoto property (using the Azure AD Graph or through AD Connect synchronization) are no longer accessible through the Microsoft Graph photo property of the user resource. Microsoft documentation Microsoft Graph API limitation talks about it, refer "photo restrictions" section.
I've successfully created a webhook subscription to listen for changes on a shared calendar (I got a 201 Created response back from the create subscription endpoint) with the following POST body:
{
"changeType": "created,updated,deleted",
"notificationUrl": <my_https_app_webhook_url>,
"resource": "/me/calendars/<calendar_id>/events",
"expirationDateTime": "2020-03-06T12:30:27.606347+00:00",
"clientState": <secret_token>
}
If I then create an event on that shared calendar with 1 attendee (aside from myself, the organizer & owner of the shared calendar) and that attendee declines the event, I don't receive a notification at my subscription notificationUrl.
Am I missing something here?
{
"changeType": "created,updated",
"notificationUrl": "https://mynotification.url.com",
"resource": "users/adminuser#oadmin.onmicrosoft.com/events",
"expirationDateTime":"2020-03-03T14:09:27.121Z",
"latestSupportedTlsVersion": "v1_2"
}
Make sure you have added,ChangeType:created,updated
This is an expected behavior as the attendee's responses do not update the event object itself, thus not triggering a notification.
I'd recommend you add this as a suggestion to UserVoice
Following response is received when creating a microsoft graph subscription .
what does this applicationId means. is it static value ?.
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#subscriptions/$entity",
"id": "7f105c7d-2dc5-4530-97cd-4e7ae6534c07",
"resource": "me/mailFolders('Inbox')/messages",
"applicationId": "24d3b144-21ae-4080-943f-7067b395b913",
"changeType": "created,updated",
"clientState": "secretClientValue",
"notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
"expirationDateTime": "2016-11-20T18:23:45.9356913Z",
"creatorId": "8ee44408-0679-472c-bc2a-692812af3437"
}
as it imply, it is client id where you register app.When you list the all subscriptions , api only returns subscriptions that are created by specific client (application).
i have confused subscription application id's which were created using graph explore and my app
We are using a multitenant application.
We created a subscription to listen to calendar events for a particular user, but we are not receiving the notifications.
The user accepted the following scopes: Calendars.Read Calendars.ReadWrite Calendars.Read.Shared Calendars.ReadWrite.Shared offline_access User.Read.All
When we call to POST https://graph.microsoft.com/v1.0/subscriptions
BODY:
{
"resource": "/users/31c61efc-bc28-4552-9f0d-1a8735767c4e/calendars/AAMkAGRjZjY3OGRmLWU3MjAtNGExYy1hOTk0LTNkNjExOWVhZmYyNQBGAAAAAAD3yBF0B84VRJLe9CCZ4-ajBwDf5J1F10FqQ6VkC14neUWZAAAAAAEGAADf5J1F10FqQ6VkC14neUWZAABEL_2XAAA\u003d/events",
"changeType": "created,updated,deleted",
"clientState": "XXXXXX",
"notificationUrl": "https://XXXXX.ngrok.io/notification/event",
"expirationDateTime": "2019-05-31T14:42:08.651Z"
}
Then the notificationUrl is called and we receive the validation token:
Validation: Testing client application reachability for subscription Request-Id: 9d020355-7589-4485-ba29-62d1ec899723
But when we login into the 31c61efc-bc28-4552-9f0d-1a8735767c4e account and update or create an event, no notification is beign sent.
If we call to GET https://graph.microsoft.com/v1.0/subscriptions the subscription is created:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "b92d909e-b1b5-49b8-af54-74b7956d6565",
"resource": "/users/31c61efc-bc28-4552-9f0d-1a8735767c4e/calendars/AAMkAGRjZjY3OGRmLWU3MjAtNGExYy1hOTk0LTNkNjExOWVhZmYyNQBGAAAAAAD3yBF0B84VRJLe9CCZ4-ajBwDf5J1F10FqQ6VkC14neUWZAAAAAAEGAADf5J1F10FqQ6VkC14neUWZAABEL_2XAAA=/events",
"applicationId": "XXXX",
"changeType": "created,updated,deleted",
"clientState": null,
"notificationUrl": "https://XXXX.ngrok.io/notification/event",
"expirationDateTime": "2019-05-31T14:42:08.651Z",
"creatorId": "31c61efc-bc28-4552-9f0d-1a8735767c4e"
}
]
}
Monitoring the ngrok calls, there is no failing call to the notification events endpoint.
Is there any console log we can verify to understand what the problem could be?
We tried to create subscriptions for different accounts with no success.
We also tried to subcribe to /me/events
Just wondering if it could the cause, but the calendar id to whom you're subscribing to is ending with \u003d instead of =. Encoding stuff. Might not be it, but for me its working well with this.
Hope its just this!
JS
I have a requirement that, I need to get notification whenever any calendar item is created/updated/deleted. I followed the Outlook push notification documentation to subscribe to calendar notifications.
I have successfully subscribed for calendar events. But whenever I create a new calendar, I am receiving notification twice.
Below is the notification request data.
First notification request data:
{
"value": [{
"#odata.type": "#Microsoft.OutlookServices.Notification",
"Id": null,
"SubscriptionId": "OTA0N0MwQj==",
"SubscriptionExpirationDateTime": "2017-09-27T05:30:49.6163119Z",
"SequenceNumber": 1,
"ChangeType": "Created",
"Resource": "https://outlook.office.com/api/v2.0/Users('1520ed5a')/Events('AAMkADAzNDUxODY=')",
"ResourceData": {
"#odata.type": "#Microsoft.OutlookServices.Event",
"#odata.id": "https://outlook.office.com/api/v2.0/Users('1520ed5a')/Events('AAMkADAzNDUxODY=')",
"#odata.etag": "W/\"DwAAABYAAAB4h4N+ELBRSbQKq1A05YT8AADcUdIx\"",
"Id": "AAMkADAzNDUxOD="
}
}]
}
Second notification request data:
{
"value": [{
"#odata.type": "#Microsoft.OutlookServices.Notification",
"Id": null,
"SubscriptionId": "OTA0N0MwQj==",
"SubscriptionExpirationDateTime": "2017-09-27T05:30:49.6163119Z",
"SequenceNumber": 2,
"ChangeType": "Updated",
"Resource": "https://outlook.office.com/api/v2.0/Users('1520ed5a')/Events('AAMkADAzNDUxODY=')",
"ResourceData": {
"#odata.type": "#Microsoft.OutlookServices.Event",
"#odata.id": "https://outlook.office.com/api/v2.0/Users('1520ed5a')/Events('AAMkADAzNDUxODY=')",
"#odata.etag": "DwAAABYAAAB4h4N+ELBRSbQKq1A05YT8AADcUdIy\"",
"Id": "AAMkADAzNDUxOD="
}
}]
}
If you observe both requests data, in first request data it's showing ChangeType as Created and in second request data it's showing ChangeType as Updated.
Same behavior (getting notification twice) when I update or delete calendar.
Any Idea how to get rid of second notification?
This isn't the expected behavior and I've been unable to replicate it myself. My best guess is that you have some other system monitoring the calendar and automatically editing the calendar events. This would explain why you get an update almost immediately following your create action.
When it comes to syncing, would recommend making use of the /delta functionality from Microsoft Graph API. When you receive a notification, you would then simply pull the /delta and return only the records that have changed. If you're receiving a false notification this would eliminate duplicate processing since the result of your second /delta would be empty. If you there is a change, but not to a property you care about, you could then discard the result and eliminate any unnecessary writes to your data store.