Microsoft Graph API를 사용하여 Outlook의 일정 이벤트를 동기화하려고합니다. 나는 내 요청에 odata.track-changes
헤더를 추가하고 내가 마지막 요청 이후에 업데이트되었거나 생성 된 이벤트 만 가져 오기 위해 나중에 요청에 사용할 수있는 deltaToken
을 수신 할 것이라고 제안한 Outlook API에 관한 this article을보고있었습니다. .캘린더 이벤트를 Microsoft Graph API와 동기화 할 수 있습니까?
나는 성공적으로 가져 오는 사건이었다,하지만 난 다시 deltaToken을받지 못했습니다 :/
이 단지 아웃룩 API에서 지원됩니까? 그래프의 응답은 Preference-Applied: odata.track-changes
이므로 내 머리글을 인정합니다.
GET /v1.0/me/calendar/calendarView
?startDateTime=2016-09-01T00:00:00.0000000
&endDateTime=2099-01-01T00:00:00.0000000
HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer XXX
Prefer: odata.track-changes
Prefer: odata.maxpagesize=3 //for testing
Cache-Control: no-cache
그리고 내 샘플 응답 : 나는 비록 약간 민감 할 수있는 아무것도 편집 됨
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('')/calendar/calendarView",
"value": [
{
"@odata.etag": "",
"id": "",
"createdDateTime": "2016-08-04T14:00:25.8552351Z",
"lastModifiedDateTime": "2016-08-25T14:43:54.9950828Z",
"changeKey": "",
"categories": [
"Orange category"
],
"originalStartTimeZone": "Eastern Standard Time",
"originalEndTimeZone": "Eastern Standard Time",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"iCalUId": "",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Closing on House",
"body": {
"contentType": "html",
"content": ""
},
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"start": {
"dateTime": "2016-09-08T19:30:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2016-09-08T21:30:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "245 E Main St",
"address": {
"street": "245 E Main St",
"city": "Somewhere",
"state": "NY",
"countryOrRegion": "United States",
"postalCode": ""
}
},
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"recurrence": null,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"attendees": [],
"organizer": {
"emailAddress": {
"name": "",
"address": ""
}
},
"webLink": "https://outlook.office365.com/owa/?ItemID="
},
{
"@odata.etag": "",
"id": "",
"createdDateTime": "2016-08-19T18:02:39.0607411Z",
"lastModifiedDateTime": "2016-08-19T18:04:10.548447Z",
"changeKey": "",
"categories": [
"Green category"
],
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"iCalUId": "",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Moving (off work)",
"body": {
"contentType": "html",
"content": ""
},
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"start": {
"dateTime": "2016-09-10T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2016-09-13T00:00:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"address": {}
},
"isAllDay": true,
"isCancelled": false,
"isOrganizer": true,
"recurrence": null,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "oof",
"type": "singleInstance",
"attendees": [],
"organizer": {
"emailAddress": {
"name": "",
"address": ""
}
},
"webLink": "https://outlook.office365.com/owa/?ItemID="
},
{
"@odata.etag": "",
"id": "",
"createdDateTime": "2016-09-13T19:05:20.8438647Z",
"lastModifiedDateTime": "2016-09-13T19:05:22.1899702Z",
"changeKey": "",
"categories": [],
"originalStartTimeZone": "America/New_York",
"originalEndTimeZone": "America/New_York",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"iCalUId": "",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Coffee Break",
"body": {
"contentType": "html",
"content": ""
},
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"start": {
"dateTime": "2016-09-15T20:15:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2016-09-15T21:15:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"address": {}
},
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"recurrence": null,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"attendees": [],
"organizer": {
"emailAddress": {
"name": "",
"address": ""
}
},
"webLink": "https://outlook.office365.com/owa/?ItemID="
}
]
}
여기 내 샘플 요청입니다. 궁극적으로, 내 Laravel 앱은 4 개월 만에 시작되는 이벤트를 동기화하려고 시도하고 있으며, 앞으로도 영원히 갈 것입니다.
더 효율적이고 효과적인 방법이 있다면 제안을 할 수 있습니다. 중요하다면이 결과는 우편 배달부에서 생성되었습니다. 이것에 대한 도움이나 명쾌함이 인정됩니다.
이봐, 내가 어떻게 도와 줄 수 있는지 좀 더 자세히 설명해 줄 수 있니? 업데이트 된 이벤트 만 가져 오기를 어떻게 관리 했습니까? 매번 모든 사건을 해결 했니? –
내가 끝낸 것은 자신의 캘린더 일정을 내 db로 다운로드하는 대신 동일한 끝점 (calendarView)을 사용하여 페이지를 방문 할 때 실시간으로 이벤트를 가져 오는 것입니다. lastModifiedDateTime을 사용하여 특정 시간 이후에 수정 된 이벤트를 가져올 수 있지만, 아무 것도 동기화하지 않아도 될 필요는 없습니다 (훨씬 쉽게). 사용자는 Outlook을 포함한 몇 가지 다른 달력 서비스의 이벤트를 표시하는 달력이 있습니다. 따라서 1 월을 클릭하면 1 월에있는 Outlook 캘린더보기에서 이벤트를 가져 와서 내 서버에 아무 것도 저장하지 않습니다. –