2

当您在 Office365 Outlook 中创建发生事件并修改任何单个事件(编辑事件)时,更改永远不会反映在从 REST API 使用的数据中。没有创建重复异常(新事件),并且系列主服务器没有更改单个字段。

预期的行为是 SeriesMaster 包含异常列表(例如按日期),并且每个异常都将创建为新的单独事件,并链接到重复头(例如:SeriesMasterId)。

{
    "@odata.id ": "https: //outlook.office365.com/api/v1.0/Users('----')",
    "@odata.etag": "----",
    "Id": "----",
    "ChangeKey": "----",
    "Categories": [],
    "DateTimeCreated": "2015-05-27T13:36:11.9330924Z",
    "DateTimeLastModified": "2015-05-27T13:44:16.2212804Z",
    "Subject": "EVRY DAY INTERVAL WITH EXCEPTIONS",
    "BodyPreview": "",
    "Body": {
        "ContentType": "HTML",
        "Content": "Example content"
    },
    "Importance": "Normal",
    "HasAttachments": false,
    "Start": "2015-04-28T00:00:00Z",
    "StartTimeZone": "UTC",
    "End": "2015-04-29T00:00:00Z",
    "EndTimeZone": "UTC",
    "Reminder": null,
    "Location": {
        "DisplayName": "",
        "Address": {
            "Street": "",
            "City": "",
            "State": "",
            "CountryOrRegion": "",
            "PostalCode": ""
        },
        "Coordinates": {
            "Accuracy": "NaN",
            "Altitude": "NaN",
            "AltitudeAccuracy": "NaN",
            "Latitude": "NaN",
            "Longitude": "NaN"
        }
    },
    "ResponseStatus": {
        "Response": "Organizer",
        "Time": "0001-01-01T00:00:00Z"
    },
    "ShowAs": "Free",
    "IsAllDay": true,
    "IsCancelled": false,
    "IsOrganizer": true,
    "ResponseRequested": true,
    "Type": "SeriesMaster",
    "SeriesMasterId": null,
    "Attendees": [],
    "Recurrence": {
        "Pattern": {
            "Type": "Daily",
            "Interval": 2,
            "Month": 0,
            "Index": "First",
            "FirstDayOfWeek": "Sunday",
            "DayOfMonth": 0
        },
        "Range": {
            "Type": "NoEnd",
            "StartDate": "2015-04-28T00:00:00+03:00",
            "EndDate": "0001-01-01T00:00:00Z",
            "NumberOfOccurrences": 0
        }
    },
    "Organizer": {
        "EmailAddress": {
            "Address": "----",
            "Name": "----"
        }
    },
    "iCalUId": "----",
    "WebLink": "----"
}

任何人都可以对此有所了解吗?目前,从 Rest API 消耗的整个 Recurrence 对象看起来(为此道歉)不完整且无用(但我在每一步都遇到了障碍)。

还有什么地方可以直接向 API 的开发团队报告问题?

4

1 回答 1

4

异常和事件实际上并未在Recurrence对象中公开。为了查看个别事件或例外情况,您需要使用CalendarView端点。这会导致 Exchange 为指定的时间窗口展开重复事件,并返回单个事件或异常。这是必要的,因为日历上的个别事件/例外不作为实际事件存在,它们是从系列主文件中派生的。如果你只是做一个 GET on /Me/Events,你永远看不到它们!

例如,我在我的日历上创建了一个重复事件,然后我将一个事件修改为在不同的时间(这使它成为一个例外)。

做一个 GET /Me/Events

{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Events",
  "value": [
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('jason@johnstonian.onmicrosoft.com')/Events('AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OABGAAAAAABp4MZ-5xP3TJnNAPmjsRslBwAoPBSqxXQOT6tuE0pxCMrtAAAAAAENAAAoPBSqxXQOT6tuE0pxCMrtAAC5xYC1AAA=')",
      "@odata.etag": "W/\"KDwUqsV0Dk+rbhNKcQjK7QAAucdOPw==\"",
      "Id": "AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OABGAAAAAABp4MZ-5xP3TJnNAPmjsRslBwAoPBSqxXQOT6tuE0pxCMrtAAAAAAENAAAoPBSqxXQOT6tuE0pxCMrtAAC5xYC1AAA=",
      "ChangeKey": "KDwUqsV0Dk+rbhNKcQjK7QAAucdOPw==",
      "Categories": [],
      "DateTimeCreated": "2015-05-28T13:39:06.310974Z",
      "DateTimeLastModified": "2015-05-28T13:39:21.0300106Z",
      "Subject": "Exception test",
      "BodyPreview": "​",
      "Body": {
        "ContentType": "HTML",
        "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<style type=\"text/css\" style=\"display:none;\"><!-- P {margin-top:0;margin-bottom:0;} --></style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<div id=\"divtagdefaultwrapper\" style=\"font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;\">\r\n<p>​&lt;br>\r\n</p>\r\n</div>\r\n</body>\r\n</html>\r\n"
      },
      "Importance": "Normal",
      "HasAttachments": false,
      "Start": "2015-05-28T20:00:00Z",
      "StartTimeZone": "Eastern Standard Time",
      "End": "2015-05-28T20:30:00Z",
      "EndTimeZone": "Eastern Standard Time",
      "Reminder": 15,
      "Location": {
        "DisplayName": "My Office",
        "Address": {
          "Street": "",
          "City": "",
          "State": "",
          "CountryOrRegion": "",
          "PostalCode": ""
        },
        "Coordinates": {
          "Accuracy": "NaN",
          "Altitude": "NaN",
          "AltitudeAccuracy": "NaN",
          "Latitude": "NaN",
          "Longitude": "NaN"
        }
      },
      "ResponseStatus": {
        "Response": "Organizer",
        "Time": "0001-01-01T00:00:00Z"
      },
      "ShowAs": "Busy",
      "IsAllDay": false,
      "IsCancelled": false,
      "IsOrganizer": true,
      "ResponseRequested": true,
      "Type": "SeriesMaster",
      "SeriesMasterId": null,
      "Attendees": [],
      "Recurrence": {
        "Pattern": {
          "Type": "Daily",
          "Interval": 1,
          "Month": 0,
          "Index": "First",
          "FirstDayOfWeek": "Sunday",
          "DayOfMonth": 0
        },
        "Range": {
          "Type": "EndDate",
          "StartDate": "2015-05-28T00:00:00-04:00",
          "EndDate": "2015-06-04T00:00:00-04:00",
          "NumberOfOccurrences": 0
        }
      },
      "Organizer": {
        "EmailAddress": {
          "Address": "jason@johnstonian.onmicrosoft.com",
          "Name": "Jason Johnston"
        }
      },
      "iCalUId": "040000008200E00074C5B7101A82E008000000006CACEEAA4B99D0010000000000000000100000009478C61D36C90847B5F3C126ACB0A17E",
      "WebLink": "https://outlook.office365.com/owa/?ItemID=AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OABGAAAAAABp4MZ%2F5xP3TJnNAPmjsRslBwAoPBSqxXQOT6tuE0pxCMrtAAAAAAENAAAoPBSqxXQOT6tuE0pxCMrtAAC5xYC1AAA%3D&exvsurl=1&viewmodel=ICalendarItemDetailsViewModelFactory"
    }
  ]
}

/Me/CalendarView在异常发生的那一天执行 GET (注意该"Type": "Exception"字段):

GET /Me/CalendarView?startDateTime=2015-05-30T04:00:00Z&endDateTime=2015-05-31T04:00:00Z

{
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('jason@johnstonian.onmicrosoft.com')/Events('AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OAFRAAgI0miCtL1AAEYAAAAAaeDGf_cT90yZzQD5o7EbJQcAKDwUqsV0Dk_rbhNKcQjK7QAAAAABDQAAKDwUqsV0Dk_rbhNKcQjK7QAAucWAtQAAEA==')",
  "@odata.etag": "W/\"KDwUqsV0Dk+rbhNKcQjK7QAAucdOPw==\"",
  "Id": "AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OAFRAAgI0miCtL1AAEYAAAAAaeDGf_cT90yZzQD5o7EbJQcAKDwUqsV0Dk_rbhNKcQjK7QAAAAABDQAAKDwUqsV0Dk_rbhNKcQjK7QAAucWAtQAAEA==",
  "ChangeKey": "KDwUqsV0Dk+rbhNKcQjK7QAAucdOPw==",
  "Categories": [],
  "DateTimeCreated": "2015-05-28T13:39:20.9676251Z",
  "DateTimeLastModified": "2015-05-28T13:39:20.9676252Z",
  "Subject": "Exception test",
  "BodyPreview": "​",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<style type=\"text/css\" style=\"display:none;\"><!-- P {margin-top:0;margin-bottom:0;} --></style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<div id=\"divtagdefaultwrapper\" style=\"font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;\">\r\n<p>​&lt;br>\r\n</p>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "Start": "2015-05-30T20:30:00Z",
  "StartTimeZone": "Eastern Standard Time",
  "End": "2015-05-30T21:00:00Z",
  "EndTimeZone": "Eastern Standard Time",
  "Reminder": 15,
  "Location": {
    "DisplayName": "My Office",
    "Address": {
      "Street": "",
      "City": "",
      "State": "",
      "CountryOrRegion": "",
      "PostalCode": ""
    },
    "Coordinates": {
      "Accuracy": "NaN",
      "Altitude": "NaN",
      "AltitudeAccuracy": "NaN",
      "Latitude": "NaN",
      "Longitude": "NaN"
    }
  },
  "ResponseStatus": {
    "Response": "Organizer",
    "Time": "0001-01-01T00:00:00Z"
  },
  "ShowAs": "Busy",
  "IsAllDay": false,
  "IsCancelled": false,
  "IsOrganizer": true,
  "ResponseRequested": true,
  "Type": "Exception",
  "SeriesMasterId": "AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OABGAAAAAABp4MZ-5xP3TJnNAPmjsRslBwAoPBSqxXQOT6tuE0pxCMrtAAAAAAENAAAoPBSqxXQOT6tuE0pxCMrtAAC5xYC1AAA=",
  "Attendees": [],
  "Recurrence": null,
  "Organizer": {
    "EmailAddress": {
      "Address": "jason@johnstonian.onmicrosoft.com",
      "Name": "Jason Johnston"
    }
  },
  "iCalUId": "040000008200E00074C5B7101A82E00807DF051E6CACEEAA4B99D0010000000000000000100000009478C61D36C90847B5F3C126ACB0A17E",
  "WebLink": "https://outlook.office365.com/owa/?ItemID=AAMkADRmMDExYzhjLWYyNGMtNDZmMC1iZDU4LTRkMjk4YTdjMjU5OAFRAAgI0miCtL1AAEYAAAAAaeDGf%2BcT90yZzQD5o7EbJQcAKDwUqsV0Dk%2BrbhNKcQjK7QAAAAABDQAAKDwUqsV0Dk%2BrbhNKcQjK7QAAucWAtQAAEA%3D%3D&exvsurl=1&viewmodel=ICalendarItemDetailsViewModelFactory"
}

此外,这是一个直接向我们报告问题的绝佳论坛。只要你的标签outlook-restapi,我们会看到它!:)

于 2015-05-28T13:58:17.670 回答