Вызов 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\":[]}