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?