Я использую ms-graph user:findMeetingTimes
api для получения свободного времени встречи данного пользователя.
Я использовал https://developer.microsoft.com/en-us/graph/graph-explorer
с POST https://graph.microsoft.com/v1.0/me/findMeetingTimes
для получения свободного времени встречи, и я использовал PythonМодуль requests
для получения той же информации с теми же параметрами, но результаты неверны при вызове с python requests
, а затем graph-explorer
.Права доступа указаны в документации .Что касается меня, похоже, что "meetingDuration": "PT1H"
не работает при вызове rest из Python api, а затем возвращается по умолчанию каждые 30 минут, как описано в документации user:findMeetingTimes
.У кого-нибудь была такая проблема?
Единственная разница - start/end
раз.Я ожидаю, что start/end
будет 1 ч (настройка "meetingDuration": "PT1H"
), но вместо этого он возвращает 30 минут, как по умолчанию
Это не проблема, если я использую graph-explorer
, который дает Microsoftдля тестирования, но проблема возникает, когда я звоню с моего Python API ...
Тело запроса:
{
"attendees": [
{
"emailAddress": {
"address": "<user-email>",
"name": "<user>"
},
"type": "Required"
}
],
"timeConstraint": {
"timeslots": [
{
"start": {
"dateTime": "2019-01-24T19:00",
"timeZone": "AUS Eastern Standard Time"
},
"end": {
"dateTime": "2019-01-24T21:00",
"timeZone": "AUS Eastern Standard Time"
}
}
]
},
"meetingDuration": "PT1H"
}
request-заголовки:
{'return-client-request-id': 'true', 'client-request-id': '<client-id>', 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', 'Prefer': 'outlook.timezone="AUS Eastern Standard Time"', 'Accept': 'application/json', 'User-Agent': 'appointments/1.0'}
Я ожидаю такой результат:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.meetingTimeSuggestionsResult",
"emptySuggestionsReason": "",
"meetingTimeSuggestions": [
{
"confidence": 100,
"organizerAvailability": "free",
"meetingTimeSlot": {
"start": {
"dateTime": "2019-01-24T19:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"end": {
"dateTime": "2019-01-24T20:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"attendeeAvailability": [],
"locations": []
},
{
"confidence": 100,
"organizerAvailability": "free",
"meetingTimeSlot": {
"start": {
"dateTime": "2019-01-24T20:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"end": {
"dateTime": "2019-01-24T21:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"attendeeAvailability": [],
"locations": []
}
]
}
Но с Python API я получаю это:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.meetingTimeSuggestionsResult",
"emptySuggestionsReason": "",
"meetingTimeSuggestions": [
{
"attendeeAvailability": [],
"confidence": 100.0,
"locations": [],
"meetingTimeSlot": {
"end": {
"dateTime": "2019-01-24T20:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"start": {
"dateTime": "2019-01-24T19:30:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"organizerAvailability": "free"
},
{
"attendeeAvailability": [],
"confidence": 100.0,
"locations": [],
"meetingTimeSlot": {
"end": {
"dateTime": "2019-01-24T20:30:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"start": {
"dateTime": "2019-01-24T20:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"organizerAvailability": "free"
},
{
"attendeeAvailability": [],
"confidence": 100.0,
"locations": [],
"meetingTimeSlot": {
"end": {
"dateTime": "2019-01-24T21:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"start": {
"dateTime": "2019-01-24T20:30:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"organizerAvailability": "free"
},
{
"attendeeAvailability": [],
"confidence": 100.0,
"locations": [],
"meetingTimeSlot": {
"end": {
"dateTime": "2019-01-24T21:30:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"start": {
"dateTime": "2019-01-24T21:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"organizerAvailability": "free"
},
{
"attendeeAvailability": [],
"confidence": 100.0,
"locations": [],
"meetingTimeSlot": {
"end": {
"dateTime": "2019-01-24T22:00:00.0000000",
"timeZone": "AUS Eastern Standard Time"
},
"start": {
"dateTime": "2019-01-24T21:30:00.0000000",
"timeZone": "AUS Eastern Standard Time"
}
},
"organizerAvailability": "free"
}
]
}
Я проверил заголовки в graph-explorer
Host: graph.microsoft.com
User-Agent: <mozilla>
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://developer.microsoft.com/en-us/graph/graph-explorer
Content-type: application/json
Authorization: Bearer <token>
Content-Length: 716
Origin: https://developer.microsoft.com
Connection: keep-alive
и заголовки в моем запросе:
{
"Accept": "application/json",
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
"Prefer": "outlook.timezone=AUS Eastern Standard Time",
"User-Agent": "myApp/1.0",
"client-request-id": "<client-id>",
"return-client-request-id": "true"
}