首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >接收每次Office 365事件更新的多个webhook通知

接收每次Office 365事件更新的多个webhook通知
EN

Stack Overflow用户
提问于 2018-03-21 18:26:02
回答 1查看 382关注 0票数 0

我正在使用同步服务器,使Office 365活动和我的日历应用保持同步

我订阅了用户事件日历的推送通知,该事件日历具有以下自定义单个扩展属性。

订阅请求有效负载示例

代码语言:javascript
复制
{
   "resource": "/me/events?$expand=singleValueExtendedProperties($filter=id%20eq%20'\''String%20{66f5a359-4659-4830-9070-00047ec6ac6e}%20Name%20CUSTOM'\'')",
   "notificationUrl": "https://serverurl.xxxx.com/dev/notification",  
   "changeType": "updated,created",
   "clientState": "123456-fad3-4191-9a66-123456789",
   "expirationDateTime": "2018-03-17T11:00:00.0000000Z"
}

然后,我对具有上述自定义单个扩展属性的日历事件执行一次更新。在更新时,同步服务器仅接收更新事件标题的多个通知(2-3个通知)。

通知1:

代码语言:javascript
复制
{
    "value": [{
        "subscriptionId": "9645fed8-dc53-4955-b3a1-2d2b9ac5728f",
        "subscriptionExpirationDateTime": "2018-03-17T11:00:00+00:00",
        "changeType": "updated",
        "resource": "<masked>",
        "resourceData": {
            "@odata.type": "#Microsoft.Graph.Event",
            "@odata.id": "<masked>",
            "@odata.etag": "W/\"+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yQ==\"",
            "id": "AAMkAGJmZjA5NzI0LWM5NTgtNGRhYy04MDExLTJmZTY4ZTJkNmVlYQBGAAAAAAC-F40EZzuzSqgA9N8VQW0zBwD4kruruobVT5oGANDbKmMhAAAAAAENAAD4kruruobVT5oGANDbKmMhAABV-OaMAAA=",
            "createdDateTime": "2018-03-13T13:30:54.740501Z",
            "lastModifiedDateTime": "2018-03-13T13:42:33.7107864Z",
            "changeKey": "+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yQ==",
            "categories": [],
            "originalStartTimeZone": "Pacific Standard Time",
            "originalEndTimeZone": "Pacific Standard Time",
            "iCalUId": "040000008200E00074C5B7101A82E0080000000006474883CFBAD30100000000000000001000000021D57F3032480543BE96AE56D8816FDF",
            "reminderMinutesBeforeStart": 15,
            "isReminderOn": true,
            "hasAttachments": false,
            "subject": "Microsoft DEMO - 2 UPDATED",
            "bodyPreview": "Let's get together!",
            "importance": "Normal",
            "sensitivity": "Normal",
            "isAllDay": false,
            "isCancelled": false,
            "isOrganizer": true,
            "responseRequested": true,
            "seriesMasterId": null,
            "showAs": "Busy",
            "type": "SingleInstance",
            "webLink": "<masked>",
            "onlineMeetingUrl": null,
            "responseStatus": {
                "Response": "Organizer",
                "Time": "0001-01-01T00:00:00Z"
            },
            "body": {
                "ContentType": "HTML",
                "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nLet's get together!\r\n</body>\r\n</html>\r\n"
            },
            "start": {
                "DateTime": "2018-03-29T01:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "end": {
                "DateTime": "2018-03-29T06:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "location": {
                "DisplayName": "",
                "LocationType": "Default",
                "UniqueIdType": "Unknown",
                "Address": {
                    "Type": "Unknown"
                },
                "Coordinates": {}
            },
            "locations": [],
            "recurrence": null,
            "attendees": [{
                "Type": "Required",
                "Status": {
                    "Response": "None",
                    "Time": "0001-01-01T00:00:00Z"
                },
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }],
            "organizer": {
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }
        },
        "clientState": "123456-fad3-4191-9a66-123456789"
    }]
}

通知2:

代码语言:javascript
复制
{
    "value": [{
        "subscriptionId": "9645fed8-dc53-4955-b3a1-2d2b9ac5728f",
        "subscriptionExpirationDateTime": "2018-03-17T11:00:00+00:00",
        "changeType": "updated",
        "resource": "<masked>",
        "resourceData": {
            "@odata.type": "#Microsoft.Graph.Event",
            "@odata.id": "<masked>",
            "@odata.etag": "W/\"+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yw==\"",
            "id": "AAMkAGJmZjA5NzI0LWM5NTgtNGRhYy04MDExLTJmZTY4ZTJkNmVlYQBGAAAAAAC-F40EZzuzSqgA9N8VQW0zBwD4kruruobVT5oGANDbKmMhAAAAAAENAAD4kruruobVT5oGANDbKmMhAABV-OaMAAA=",
            "createdDateTime": "2018-03-13T13:30:54.740501Z",
            "lastModifiedDateTime": "2018-03-13T13:42:33.869926Z",
            "changeKey": "+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yw==",
            "categories": [],
            "originalStartTimeZone": "Pacific Standard Time",
            "originalEndTimeZone": "Pacific Standard Time",
            "iCalUId": "<masked>",
            "reminderMinutesBeforeStart": 15,
            "isReminderOn": true,
            "hasAttachments": false,
            "subject": "Microsoft DEMO - 2 UPDATED",
            "bodyPreview": "Let's get together!",
            "importance": "Normal",
            "sensitivity": "Normal",
            "isAllDay": false,
            "isCancelled": false,
            "isOrganizer": true,
            "responseRequested": true,
            "seriesMasterId": null,
            "showAs": "Busy",
            "type": "SingleInstance",
            "webLink": "<masked>",
            "onlineMeetingUrl": null,
            "responseStatus": {
                "Response": "Organizer",
                "Time": "0001-01-01T00:00:00Z"
            },
            "body": {
                "ContentType": "HTML",
                "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nLet's get together!\r\n</body>\r\n</html>\r\n"
            },
            "start": {
                "DateTime": "2018-03-29T01:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "end": {
                "DateTime": "2018-03-29T06:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "location": {
                "DisplayName": "",
                "LocationType": "Default",
                "UniqueIdType": "Unknown",
                "Address": {
                    "Type": "Unknown"
                },
                "Coordinates": {}
            },
            "locations": [],
            "recurrence": null,
            "attendees": [{
                "Type": "Required",
                "Status": {
                    "Response": "None",
                    "Time": "0001-01-01T00:00:00Z"
                },
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }],
            "organizer": {
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }
        },
        "clientState": "123456-fad3-4191-9a66-123456789"
    }]
}

通知3:

代码语言:javascript
复制
{
    "value": [{
        "subscriptionId": "9645fed8-dc53-4955-b3a1-2d2b9ac5728f",
        "subscriptionExpirationDateTime": "2018-03-17T11:00:00+00:00",
        "changeType": "updated",
        "resource": "<masked>",
        "resourceData": {
            "@odata.type": "#Microsoft.Graph.Event",
            "@odata.id": "<masked>",
            "@odata.etag": "W/\"+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yw==\"",
            "id": "AAMkAGJmZjA5NzI0LWM5NTgtNGRhYy04MDExLTJmZTY4ZTJkNmVlYQBGAAAAAAC-F40EZzuzSqgA9N8VQW0zBwD4kruruobVT5oGANDbKmMhAAAAAAENAAD4kruruobVT5oGANDbKmMhAABV-OaMAAA=",
            "createdDateTime": "2018-03-13T13:30:54.740501Z",
            "lastModifiedDateTime": "2018-03-13T13:42:33.869926Z",
            "changeKey": "+JK7q7qG1U+aBgDQ2ypjIQAAVnP6yw==",
            "categories": [],
            "originalStartTimeZone": "Pacific Standard Time",
            "originalEndTimeZone": "Pacific Standard Time",
            "iCalUId": "<masked>",
            "reminderMinutesBeforeStart": 15,
            "isReminderOn": true,
            "hasAttachments": false,
            "subject": "Microsoft DEMO - 2 UPDATED",
            "bodyPreview": "Let's get together!",
            "importance": "Normal",
            "sensitivity": "Normal",
            "isAllDay": false,
            "isCancelled": false,
            "isOrganizer": true,
            "responseRequested": true,
            "seriesMasterId": null,
            "showAs": "Busy",
            "type": "SingleInstance",
            "webLink": "<masked>",
            "onlineMeetingUrl": null,
            "responseStatus": {
                "Response": "Organizer",
                "Time": "0001-01-01T00:00:00Z"
            },
            "body": {
                "ContentType": "HTML",
                "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nLet's get together!\r\n</body>\r\n</html>\r\n"
            },
            "start": {
                "DateTime": "2018-03-29T01:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "end": {
                "DateTime": "2018-03-29T06:00:00Z",
                "TimeZone": "tzone://Microsoft/Utc"
            },
            "location": {
                "DisplayName": "",
                "LocationType": "Default",
                "UniqueIdType": "Unknown",
                "Address": {
                    "Type": "Unknown"
                },
                "Coordinates": {}
            },
            "locations": [],
            "recurrence": null,
            "attendees": [{
                "Type": "Required",
                "Status": {
                    "Response": "None",
                    "Time": "0001-01-01T00:00:00Z"
                },
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }],
            "organizer": {
                "EmailAddress": {
                    "Name": "<masked>",
                    "Address": "<masked>"
                }
            }
        },
        "clientState": "123456-fad3-4191-9a66-123456789"
    }]
}

我希望每次更新只有一个通知(在我的例子中,我只是更新了事件标题),但是服务器收到了多个通知,只是通知中的@odata.etag不同。这是意料之中的吗?

EN

回答 1

Stack Overflow用户

发布于 2018-04-07 02:15:44

当对任何项目进行更改时,服务器可能需要对该项目以及幕后的其他相关项目执行多次修改。这些修改中的每一个都会导致通知。也可能有其他实体正在侦听更改,并对其做出反应,这可能会导致进一步的更改,从而导致更多关于该项目的通知。因此,简而言之,不能保证单次API调用可能会收到多少通知。对于通常涉及服务器上的复杂工作流的高级日历操作,这一点尤其正确。

在这种情况下,您可以看到,实际上您收到了三个不同的更改密钥,表明该项已被多次修改。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49403807

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档