调用 https://graph.microsoft.com/v1.0/users/<ID Calendar>/calendar/calendarView? return 没有约会,有约会

Calling https://graph.microsoft.com/v1.0/users/<ID Calendar>/calendar/calendarView? doesn't return appointments, and there is appointments

从昨天开始,对 Graph API 的调用无法正常工作:

https://graph.microsoft.com/v1.0/users/<my calendar ID>/calendar/calendarView?startDateTime=2019-10-04T19:10:24.0000000&endDateTime=2019-11-03T19:10:24.0000000&top=100

return正在处理 0 个事件 - 约会,并且有约会要在

上列出

自上个月以来,该呼叫直到昨天才正常工作,每 8 分钟一次,24x7:

// List events.
string fini = string.Format("{0}-{1}-{2}T{3}:{4}:{5}.0000000",                                                  
UpDateTime.Year.ToString("0000"),                                                    
UpDateTime.Month.ToString("00"),                                                    
UpDateTime.Day.ToString("00"),                                                    
UpDateTime.Hour.ToString("00"),                                                    
UpDateTime.Minute.ToString("00"),                                              
UpDateTime.Second.ToString("00")
                                                );
string ffin = string.Format("{0}-{1}-{2}T{3}:{4}:{5}.0000000", // 
                                                EndTime.Year.ToString("0000"),
                                                EndTime.Month.ToString("00"),
                                                EndTime.Day.ToString("00"),
                                                EndTime.Hour.ToString("00"),
                                                EndTime.Minute.ToString("00"),
                                                EndTime.Second.ToString("00")
                                                );
                String _requestURI = _GraphURLEvents.Replace("events", "calendarView") + string.Format("?startDateTime={0}&endDateTime={1}&top=100", fini, ffin);
                _requestURI = String.Format(_requestURI, _userId);
                HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, _requestURI);
                //Authentication token
                request.Headers.Add("Prefer", "outlook.timezone=\"Romance Standard Time\"");
                request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", System.Web.HttpUtility.UrlEncode(access_token));

                HttpClient client = new HttpClient();
                var response = await client.SendAsync(request)
                var returnURL = await 
response.Content.ReadAsStringAsync();

获取实物呼叫returns:

{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked 
 request-id: <r>
  client-request-id: <t>
  x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_52","ADSiteName":"WEU"}}
  Preference-Applied: outlook.timezone="Romance Standard Time"
  OData-Version: 4.0
  Duration: 66.8258
  Strict-Transport-Security: max-age=31536000
  Cache-Control: private
  Date: Fri, 04 Oct 2019 17:11:31 GMT
  Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8
}}
    Content: {System.Net.Http.StreamContent}
    Headers: {Transfer-Encoding: chunked
request-id: <x>
client-request-id: <y>
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_52","ADSiteName":"WEU"}}
Preference-Applied: outlook.timezone="Romance Standard Time"
OData-Version: 4.0
Duration: 66.8258
Strict-Transport-Security: max-age=31536000
Cache-Control: private
Date: Fri, 04 Oct 2019 17:11:31 GMT
}
    IsSuccessStatusCode: true
    ReasonPhrase: "OK"
    RequestMessage: {Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/users/<mycalendar>/calendar/calendarView?startDateTime=2019-10-04T19:10:24.0000000&endDateTime=2019-11-03T19:10:24.0000000&top=100', Version: 1.1, Content: <null>, Headers:
{
  Prefer: outlook.timezone="Romance Standard Time"
  Authorization: Bearer <my authorization bearer>
}}
    StatusCode: OK
    Version: {1.1}

该调用必须 return 类似于 :

https://docs.microsoft.com/en-us/graph/api/user-list-calendarview?view=graph-rest-1.0&tabs=http

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 354
{
"value": [
{
  "originalStartTimeZone": "originalStartTimeZone-value",
  "originalEndTimeZone": "originalEndTimeZone-value",
  "responseStatus": {
    "response": "",
    "time": "datetime-value"
  },
  "iCalUId": "iCalUId-value",
  "reminderMinutesBeforeStart": 99,
  "isReminderOn": true
}
  ]
}

...从昨天开始,结果是:

{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#users('<calendarId>')/calendar/calendarView\",\"value\":[]}

根据我的测试,url 应该是:

1。获取特定用户的日历

https://graph.microsoft.com/v1.0/users/<user_id>/calendar/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100

https://graph.microsoft.com/v1.0/users/<user_id>/calendars/<calendar_id>/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100

2。获取我的日历

https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100

https://graph.microsoft.com/v1.0/me/calendars/<calendar_id>/calendarView?startDateTime=2019-10-06T16:00:00Z&endDateTime=2019-10-10T16:00:00Z&top=100

我可以从上面的 url 中得到成功的响应。


对了,请检查您是否设置了正确的时间段。时间戳应该是 UTC 格式。