正在调用https://graph.microsoft.com/v1.0/users/ /calendar/calendarView?没有返回约会,并且有约会

问题描述 投票:1回答:1

从昨天开始对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

正在返回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();

获得种类的CALL返回:

{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}

该呼叫必须返回类似:

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\":[]}

自昨天以来,对Graph API的调用无法正常工作:https://graph.microsoft.com/v1.0/users//calendar/calendarView?startDateTime=2019-10-04T19:10:24.0000000&。 ..

api office365 microsoft-graph azure-ad-graph-api
1个回答
0
投票

根据我的测试,该网址应为:

© www.soinside.com 2019 - 2024. All rights reserved.