名前空間: microsoft.graph
パラメーターとして指定された開催者と出席者の空き時間、および時間または場所の制約に基づいて、会議の時間と場所を提案します。
findMeetingTimes が会議提案を返すことができない場合は、応答で、emptySuggestionsReason プロパティに理由が示されます。
この値に基づいて、パラメーターをさらに調整して、findMeetingTimes を再度呼び出すことができます。
会議の時間と場所を提案するために使用されるアルゴリズムは、随時微調整されます。 入力パラメーターと予定表のデータが静的な状態のテスト環境のようなシナリオでは、提案される結果は時間の経過とともに変化する可能性があります。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
特権の高いアクセス許可 |
委任 (職場または学校のアカウント) |
Calendars.Read.Shared |
Calendars.ReadWrite.Shared |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
サポートされていません。 |
サポートされていません。 |
HTTP 要求
POST /me/findMeetingTimes
POST /users/{id|userPrincipalName}/findMeetingTimes
名前 |
値 |
Authorization |
ベアラー {token}。 必須です。
認証と承認の詳細については、こちらをご覧ください。 |
優先: outlook.timezone |
応答として "太平洋標準時" などの特定のタイム ゾーンを表す文字列です。 省略可能です。 このヘッダーが指定されていない場合は、UTC が使用されます。 |
要求本文
サポートされているすべてのパラメーターは以下のとおりです。 シナリオに応じて、要求本文で必要な各パラメーターの JSON オブジェクトを指定します。
パラメーター |
型 |
説明 |
attendees |
attendeeBase コレクション |
会議の出席者またはリソースのコレクションです。 findMeetingTimes は、ユーザーである出席者が常に必要であると想定しているため、対応する型プロパティのユーザーとresource リソースに対して を指定required します。 コレクションを空にすると、findMeetingTimes は開催者のみの空き時間帯を検索します。 省略可能です。 |
isOrganizerOptional |
Edm.Boolean |
開催者が必ずしも出席する必要がない場合は、True を指定します。 既定値は false です。 省略可能です。 |
locationConstraint |
locationConstraint |
会議の場所の提案が必要かどうか、または会議のみが開催できる特定の場所があるか、など、会議の場所に関する開催者の要件。 省略可能です。 |
maxCandidates |
Edm.Int32 |
返される会議時間の提案の最大数です。 オプション。 |
meetingDuration |
Edm.Duration |
ISO8601 形式で示された会議の長さです。 たとえば、1 時間は "PT1H" として表され、"P" は期間指定子、'T' は時間指定子、'H' は時間指定子です。 M を使用して、期間の分数を示します。たとえば、2 時間 30 分は "PT2H30M" になります。 会議の期間を指定しない場合、findMeetingTimes は既定値の 30 分を使用します。 省略可能です。 |
minimumAttendeePercentage |
Edm.Double |
応答で返される時間帯に最低限要求される確度です。 割合 (%) の値 (0 から 100 まで)。 省略可能です。 |
returnSuggestionReasons |
Edm.Boolean |
suggestionReason プロパティで会議の提案ごとに理由を返すには、 を指定True します。 既定値は false であり、そのプロパティを返しません。 省略可能です。 |
timeConstraint |
timeConstraint |
会議の時間制限。これには、会議の性質 (activityDomain プロパティ) と会議の期間 (timeSlots プロパティ) が含まれます。
findMeetingTimes では、 このパラメーターを指定しないかのように activityDomainwork が想定されます。 オプション。 |
timeConstraint パラメーターにさらに指定できる activityDomain 制限について、次の表で説明します。
activityDomain 値 |
会議の時間の候補 |
作業時間 |
提案は、ユーザーの予定表構成で定義され、ユーザーまたは管理者によってカスタマイズできるユーザーの勤務時間内です。 既定の勤務時間は、メールボックスのタイム ゾーン セットの月曜日から金曜日の午前 8 時から午後 5 時です。
activityDomain が指定されていない場合、これは既定値です。 |
personal |
提案は、ユーザーの勤務時間内、および土曜日と日曜日です。 既定では、メールボックスのタイム ゾーン設定では、月曜日から日曜日、午前 8 時から午後 5 時です。 |
Unrestricted |
任意の曜日の任意の時刻から候補が提案されます。 |
不明 |
この値は、今後非推奨になる予定であるため使用しないでください。 現在、 は と work 同じように動作します。 を使用work personal するように、またはunrestricted 必要に応じて既存のコードを変更します。 |
指定したパラメーターに基づいて、findMeetingTimes は開催者と出席者の標準として設定されている予定表で空き時間状態を確認します。 アクションは、開催できる可能性が最も高い会議の日時を計算し、会議の提案を返します。
応答
成功した場合、このメソッドは 200 OK
応答コードと、応答本文に入った meetingTimeSuggestionsResult を返します。
meetingTimeSuggestionsResult には、会議提案のコレクションと emptySuggestionsReason プロパティが含まれます。 各提案は、meetingTimeSuggestion として定義され、出席者の参加の確度について、平均で 50% またはminimumAttendeePercentage パラメーターで指定した特定の割合 (%) が付されます。
既定では、会議の日時についての各提案は UTC で返されます。
findMeetingTimes が会議提案を返すことができない場合は、応答で、emptySuggestionsReason プロパティに理由が示されます。
この値に基づいて、パラメーターをさらに調整して、findMeetingTimes を再度呼び出すことができます。
会議の提案の確実性
meetingTimeSuggestion の confidence プロパティの範囲は 0% から 100% で、各個人の空き時間状態に基づいて会議に出席するすべての出席者の見込みを表します。
- 各出席者に関する、指定の会議期間の空き状態で、確実に出席する場合は 100%、不明な状態は 49%、忙しい場合には 0% です。
- 会議時間の提案の確実性は、指定された対象会議のすべての出席者の出席見込みの平均によって算出されます。
-
findMeetingTimes に minimumAttendeePercentage 省略可能なパラメーターを使用して、少なくとも特定の信頼度レベルの会議時間候補のみを指定できます。 たとえば、すべての出席者が出席する可能性が 80% 以上の提案のみを必要とする場合は、 minimumAttendeePercentage を 80% に指定できます。
minimumAttendeePercentage を指定しない場合、findMeetingTimes は 50% の値を想定します。
- 会議時間の提案が複数ある場合、findMeetingTimes アクションは、算出した確実性が高い方から順番に提案を並べて示します。 確実性が同じ提案がある場合には、時系列で提案を並べて示します。
たとえば、提案の会議時間に次の空き時間状態の 3 人の出席者がいるとします。
出席者 |
空き時間状態 |
出席見込み (%) |
Dana |
空き |
100% |
John |
不明 |
49% |
Samantha |
多忙 |
0% |
この場合、出席の平均見込みである会議時間の提案の信頼度は、(100% + 49% + 0%)/3 = 49.66% です。
findMeetingTimes 操作で minimumAttendeePercentage を 80% に指定した場合、49.66% 80% < であるため、この操作は応答でこの時間を推奨しません。
例
次の例は、要求本文で次のパラメーターを指定して、あらかじめ決められた会議を開催する時間を検索し、各提案の理由を要求する方法を示しています。
-
attendees
-
locationConstraint
-
timeConstraint
-
isOrganizerOptional
-
meetingDuration
-
returnSuggestionReasons
-
minimumAttendeePercentage
findMeetingTimes が任意の提案を返す場合は、returnSuggestionReasons パラメーターを設定することで、各提案の SuggestionReason プロパティの説明も取得できます。
この要求では PST タイム ゾーンで時間を指定します。 既定では、UTC での会議の時間の候補を応答で返します。 PST を指定するのに、また応答の時間の値にも Prefer: outlook.timezone
要求ヘッダーを使うことができます。
要求
要求の例を次に示します。
POST https://graph.microsoft.com/v1.0/me/findMeetingTimes
Prefer: outlook.timezone="Pacific Standard Time"
Content-Type: application/json
{
"attendees": [
{
"type": "required",
"emailAddress": {
"name": "Alex Wilbur",
"address": "alexw@contoso.com"
}
}
],
"locationConstraint": {
"isRequired": false,
"suggestLocation": false,
"locations": [
{
"resolveAvailability": false,
"displayName": "Conf room Hood"
}
]
},
"timeConstraint": {
"activityDomain":"work",
"timeSlots": [
{
"start": {
"dateTime": "2019-04-16T09:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T17:00:00",
"timeZone": "Pacific Standard Time"
}
}
]
},
"isOrganizerOptional": "false",
"meetingDuration": "PT1H",
"returnSuggestionReasons": "true",
"minimumAttendeePercentage": 100
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.FindMeetingTimes;
using Microsoft.Graph.Models;
var requestBody = new FindMeetingTimesPostRequestBody
{
Attendees = new List<AttendeeBase>
{
new AttendeeBase
{
Type = AttendeeType.Required,
EmailAddress = new EmailAddress
{
Name = "Alex Wilbur",
Address = "alexw@contoso.com",
},
},
},
LocationConstraint = new LocationConstraint
{
IsRequired = false,
SuggestLocation = false,
Locations = new List<LocationConstraintItem>
{
new LocationConstraintItem
{
ResolveAvailability = false,
DisplayName = "Conf room Hood",
},
},
},
TimeConstraint = new TimeConstraint
{
ActivityDomain = ActivityDomain.Work,
TimeSlots = new List<TimeSlot>
{
new TimeSlot
{
Start = new DateTimeTimeZone
{
DateTime = "2019-04-16T09:00:00",
TimeZone = "Pacific Standard Time",
},
End = new DateTimeTimeZone
{
DateTime = "2019-04-18T17:00:00",
TimeZone = "Pacific Standard Time",
},
},
},
},
IsOrganizerOptional = false,
MeetingDuration = TimeSpan.Parse("PT1H"),
ReturnSuggestionReasons = true,
MinimumAttendeePercentage = 100d,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.FindMeetingTimes.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc users find-meeting-times post --user-id {user-id} --body '{\
"attendees": [\
{\
"type": "required",\
"emailAddress": {\
"name": "Alex Wilbur",\
"address": "alexw@contoso.com"\
}\
}\
],\
"locationConstraint": {\
"isRequired": false,\
"suggestLocation": false,\
"locations": [\
{\
"resolveAvailability": false,\
"displayName": "Conf room Hood"\
}\
]\
},\
"timeConstraint": {\
"activityDomain":"work",\
"timeSlots": [\
{\
"start": {\
"dateTime": "2019-04-16T09:00:00",\
"timeZone": "Pacific Standard Time"\
},\
"end": {\
"dateTime": "2019-04-18T17:00:00",\
"timeZone": "Pacific Standard Time"\
}\
}\
]\
},\
"isOrganizerOptional": "false",\
"meetingDuration": "PT1H",\
"returnSuggestionReasons": "true",\
"minimumAttendeePercentage": 100\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
configuration := &graphusers.ItemFindMeetingTimesRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphusers.NewItemFindMeetingTimesPostRequestBody()
attendeeBase := graphmodels.NewAttendeeBase()
type := graphmodels.REQUIRED_ATTENDEETYPE
attendeeBase.SetType(&type)
emailAddress := graphmodels.NewEmailAddress()
name := "Alex Wilbur"
emailAddress.SetName(&name)
address := "alexw@contoso.com"
emailAddress.SetAddress(&address)
attendeeBase.SetEmailAddress(emailAddress)
attendees := []graphmodels.AttendeeBaseable {
attendeeBase,
}
requestBody.SetAttendees(attendees)
locationConstraint := graphmodels.NewLocationConstraint()
isRequired := false
locationConstraint.SetIsRequired(&isRequired)
suggestLocation := false
locationConstraint.SetSuggestLocation(&suggestLocation)
locationConstraintItem := graphmodels.NewLocationConstraintItem()
resolveAvailability := false
locationConstraintItem.SetResolveAvailability(&resolveAvailability)
displayName := "Conf room Hood"
locationConstraintItem.SetDisplayName(&displayName)
locations := []graphmodels.LocationConstraintItemable {
locationConstraintItem,
}
locationConstraint.SetLocations(locations)
requestBody.SetLocationConstraint(locationConstraint)
timeConstraint := graphmodels.NewTimeConstraint()
activityDomain := graphmodels.WORK_ACTIVITYDOMAIN
timeConstraint.SetActivityDomain(&activityDomain)
timeSlot := graphmodels.NewTimeSlot()
start := graphmodels.NewDateTimeTimeZone()
dateTime := "2019-04-16T09:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
timeSlot.SetStart(start)
end := graphmodels.NewDateTimeTimeZone()
dateTime := "2019-04-18T17:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
timeSlot.SetEnd(end)
timeSlots := []graphmodels.TimeSlotable {
timeSlot,
}
timeConstraint.SetTimeSlots(timeSlots)
requestBody.SetTimeConstraint(timeConstraint)
isOrganizerOptional := false
requestBody.SetIsOrganizerOptional(&isOrganizerOptional)
meetingDuration , err := abstractions.ParseISODuration("PT1H")
requestBody.SetMeetingDuration(&meetingDuration)
returnSuggestionReasons := true
requestBody.SetReturnSuggestionReasons(&returnSuggestionReasons)
minimumAttendeePercentage := float64(100)
requestBody.SetMinimumAttendeePercentage(&minimumAttendeePercentage)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
findMeetingTimes, err := graphClient.Me().FindMeetingTimes().Post(context.Background(), requestBody, configuration)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.users.item.findmeetingtimes.FindMeetingTimesPostRequestBody findMeetingTimesPostRequestBody = new com.microsoft.graph.users.item.findmeetingtimes.FindMeetingTimesPostRequestBody();
LinkedList<AttendeeBase> attendees = new LinkedList<AttendeeBase>();
AttendeeBase attendeeBase = new AttendeeBase();
attendeeBase.setType(AttendeeType.Required);
EmailAddress emailAddress = new EmailAddress();
emailAddress.setName("Alex Wilbur");
emailAddress.setAddress("alexw@contoso.com");
attendeeBase.setEmailAddress(emailAddress);
attendees.add(attendeeBase);
findMeetingTimesPostRequestBody.setAttendees(attendees);
LocationConstraint locationConstraint = new LocationConstraint();
locationConstraint.setIsRequired(false);
locationConstraint.setSuggestLocation(false);
LinkedList<LocationConstraintItem> locations = new LinkedList<LocationConstraintItem>();
LocationConstraintItem locationConstraintItem = new LocationConstraintItem();
locationConstraintItem.setResolveAvailability(false);
locationConstraintItem.setDisplayName("Conf room Hood");
locations.add(locationConstraintItem);
locationConstraint.setLocations(locations);
findMeetingTimesPostRequestBody.setLocationConstraint(locationConstraint);
TimeConstraint timeConstraint = new TimeConstraint();
timeConstraint.setActivityDomain(ActivityDomain.Work);
LinkedList<TimeSlot> timeSlots = new LinkedList<TimeSlot>();
TimeSlot timeSlot = new TimeSlot();
DateTimeTimeZone start = new DateTimeTimeZone();
start.setDateTime("2019-04-16T09:00:00");
start.setTimeZone("Pacific Standard Time");
timeSlot.setStart(start);
DateTimeTimeZone end = new DateTimeTimeZone();
end.setDateTime("2019-04-18T17:00:00");
end.setTimeZone("Pacific Standard Time");
timeSlot.setEnd(end);
timeSlots.add(timeSlot);
timeConstraint.setTimeSlots(timeSlots);
findMeetingTimesPostRequestBody.setTimeConstraint(timeConstraint);
findMeetingTimesPostRequestBody.setIsOrganizerOptional(false);
PeriodAndDuration meetingDuration = PeriodAndDuration.ofDuration(Duration.parse("PT1H"));
findMeetingTimesPostRequestBody.setMeetingDuration(meetingDuration);
findMeetingTimesPostRequestBody.setReturnSuggestionReasons(true);
findMeetingTimesPostRequestBody.setMinimumAttendeePercentage(100d);
var result = graphClient.me().findMeetingTimes().post(findMeetingTimesPostRequestBody, requestConfiguration -> {
requestConfiguration.headers.add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const meetingTimeSuggestionsResult = {
attendees: [
{
type: 'required',
emailAddress: {
name: 'Alex Wilbur',
address: 'alexw@contoso.com'
}
}
],
locationConstraint: {
isRequired: false,
suggestLocation: false,
locations: [
{
resolveAvailability: false,
displayName: 'Conf room Hood'
}
]
},
timeConstraint: {
activityDomain: 'work',
timeSlots: [
{
start: {
dateTime: '2019-04-16T09:00:00',
timeZone: 'Pacific Standard Time'
},
end: {
dateTime: '2019-04-18T17:00:00',
timeZone: 'Pacific Standard Time'
}
}
]
},
isOrganizerOptional: 'false',
meetingDuration: 'PT1H',
returnSuggestionReasons: 'true',
minimumAttendeePercentage: 100
};
await client.api('/me/findMeetingTimes')
.post(meetingTimeSuggestionsResult);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\FindMeetingTimes\FindMeetingTimesRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Generated\Users\Item\FindMeetingTimes\FindMeetingTimesPostRequestBody;
use Microsoft\Graph\Generated\Models\AttendeeBase;
use Microsoft\Graph\Generated\Models\AttendeeType;
use Microsoft\Graph\Generated\Models\EmailAddress;
use Microsoft\Graph\Generated\Models\LocationConstraint;
use Microsoft\Graph\Generated\Models\LocationConstraintItem;
use Microsoft\Graph\Generated\Models\TimeConstraint;
use Microsoft\Graph\Generated\Models\ActivityDomain;
use Microsoft\Graph\Generated\Models\TimeSlot;
use Microsoft\Graph\Generated\Models\DateTimeTimeZone;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new FindMeetingTimesPostRequestBody();
$attendeesAttendeeBase1 = new AttendeeBase();
$attendeesAttendeeBase1->setType(new AttendeeType('required'));
$attendeesAttendeeBase1EmailAddress = new EmailAddress();
$attendeesAttendeeBase1EmailAddress->setName('Alex Wilbur');
$attendeesAttendeeBase1EmailAddress->setAddress('alexw@contoso.com');
$attendeesAttendeeBase1->setEmailAddress($attendeesAttendeeBase1EmailAddress);
$attendeesArray []= $attendeesAttendeeBase1;
$requestBody->setAttendees($attendeesArray);
$locationConstraint = new LocationConstraint();
$locationConstraint->setIsRequired(false);
$locationConstraint->setSuggestLocation(false);
$locationsLocationConstraintItem1 = new LocationConstraintItem();
$locationsLocationConstraintItem1->setResolveAvailability(false);
$locationsLocationConstraintItem1->setDisplayName('Conf room Hood');
$locationsArray []= $locationsLocationConstraintItem1;
$locationConstraint->setLocations($locationsArray);
$requestBody->setLocationConstraint($locationConstraint);
$timeConstraint = new TimeConstraint();
$timeConstraint->setActivityDomain(new ActivityDomain('work'));
$timeSlotsTimeSlot1 = new TimeSlot();
$timeSlotsTimeSlot1Start = new DateTimeTimeZone();
$timeSlotsTimeSlot1Start->setDateTime('2019-04-16T09:00:00');
$timeSlotsTimeSlot1Start->setTimeZone('Pacific Standard Time');
$timeSlotsTimeSlot1->setStart($timeSlotsTimeSlot1Start);
$timeSlotsTimeSlot1End = new DateTimeTimeZone();
$timeSlotsTimeSlot1End->setDateTime('2019-04-18T17:00:00');
$timeSlotsTimeSlot1End->setTimeZone('Pacific Standard Time');
$timeSlotsTimeSlot1->setEnd($timeSlotsTimeSlot1End);
$timeSlotsArray []= $timeSlotsTimeSlot1;
$timeConstraint->setTimeSlots($timeSlotsArray);
$requestBody->setTimeConstraint($timeConstraint);
$requestBody->setIsOrganizerOptional(false);
$requestBody->setMeetingDuration(new \DateInterval('PT1H'));
$requestBody->setReturnSuggestionReasons(true);
$requestBody->setMinimumAttendeePercentage(100);
$requestConfiguration = new FindMeetingTimesRequestBuilderPostRequestConfiguration();
$headers = [
'Prefer' => 'outlook.timezone="Pacific Standard Time"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->findMeetingTimes()->post($requestBody, $requestConfiguration)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.find_meeting_times.find_meeting_times_request_builder import FindMeetingTimesRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph.generated.users.item.find_meeting_times.find_meeting_times_post_request_body import FindMeetingTimesPostRequestBody
from msgraph.generated.models.attendee_base import AttendeeBase
from msgraph.generated.models.attendee_type import AttendeeType
from msgraph.generated.models.email_address import EmailAddress
from msgraph.generated.models.location_constraint import LocationConstraint
from msgraph.generated.models.location_constraint_item import LocationConstraintItem
from msgraph.generated.models.time_constraint import TimeConstraint
from msgraph.generated.models.activity_domain import ActivityDomain
from msgraph.generated.models.time_slot import TimeSlot
from msgraph.generated.models.date_time_time_zone import DateTimeTimeZone
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FindMeetingTimesPostRequestBody(
attendees = [
AttendeeBase(
type = AttendeeType.Required,
email_address = EmailAddress(
name = "Alex Wilbur",
address = "alexw@contoso.com",
),
),
],
location_constraint = LocationConstraint(
is_required = False,
suggest_location = False,
locations = [
LocationConstraintItem(
resolve_availability = False,
display_name = "Conf room Hood",
),
],
),
time_constraint = TimeConstraint(
activity_domain = ActivityDomain.Work,
time_slots = [
TimeSlot(
start = DateTimeTimeZone(
date_time = "2019-04-16T09:00:00",
time_zone = "Pacific Standard Time",
),
end = DateTimeTimeZone(
date_time = "2019-04-18T17:00:00",
time_zone = "Pacific Standard Time",
),
),
],
),
is_organizer_optional = False,
meeting_duration = "PT1H",
return_suggestion_reasons = True,
minimum_attendee_percentage = 100,
)
request_configuration = RequestConfiguration()
request_configuration.headers.add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
result = await graph_client.me.find_meeting_times.post(request_body, request_configuration = request_configuration)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を次に示します。 注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
Preference-Applied: outlook.timezone="Pacific Standard Time"
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.meetingTimeSuggestionsResult",
"emptySuggestionsReason": "",
"meetingTimeSuggestions": [
{
"confidence": 100,
"order": 1,
"organizerAvailability": "free",
"suggestionReason": "Suggested because it is one of the nearest times when all attendees are available.",
"attendeeAvailability": [
{
"availability": "free",
"attendee": {
"emailAddress": {
"address": "alexw@contoso.com"
}
}
}
],
"locations": [
{
"displayName": "Conf room Hood"
}
],
"meetingTimeSlot": {
"start": {
"dateTime": "2019-04-18T16:00:00.0000000",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T17:00:00.0000000",
"timeZone": "Pacific Standard Time"
}
}
},
{
"confidence": 100,
"order": 2,
"organizerAvailability": "free",
"suggestionReason": "Suggested because it is one of the nearest times when all attendees are available.",
"attendeeAvailability": [
{
"availability": "free",
"attendee": {
"emailAddress": {
"address": "alexw@contoso.com"
}
}
}
],
"locations": [
{
"displayName": "Conf room Hood"
}
],
"meetingTimeSlot": {
"start": {
"dateTime": "2019-04-18T08:00:00.0000000",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T09:00:00.0000000",
"timeZone": "Pacific Standard Time"
}
}
},
{
"confidence": 100,
"order": 3,
"organizerAvailability": "tentative",
"suggestionReason": "Suggested because it is one of the nearest times when all attendees are available.",
"attendeeAvailability": [
{
"availability": "free",
"attendee": {
"emailAddress": {
"address": "alexw@contoso.com"
}
}
}
],
"locations": [
{
"displayName": "Conf room Hood"
}
],
"meetingTimeSlot": {
"start": {
"dateTime": "2019-04-18T15:00:00.0000000",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T16:00:00.0000000",
"timeZone": "Pacific Standard Time"
}
}
},
{
"confidence": 100,
"order": 4,
"organizerAvailability": "tentative",
"suggestionReason": "Suggested because it is one of the nearest times when all attendees are available.",
"attendeeAvailability": [
{
"availability": "free",
"attendee": {
"emailAddress": {
"address": "alexw@contoso.com"
}
}
}
],
"locations": [
{
"displayName": "Conf room Hood"
}
],
"meetingTimeSlot": {
"start": {
"dateTime": "2019-04-18T09:00:00.0000000",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T10:00:00.0000000",
"timeZone": "Pacific Standard Time"
}
}
},
{
"confidence": 100,
"order": 5,
"organizerAvailability": "tentative",
"suggestionReason": "Suggested because it is one of the nearest times when all attendees are available.",
"attendeeAvailability": [
{
"availability": "free",
"attendee": {
"emailAddress": {
"address": "alexw@contoso.com"
}
}
}
],
"locations": [
{
"displayName": "Conf room Hood"
}
],
"meetingTimeSlot": {
"start": {
"dateTime": "2019-04-18T12:00:00.0000000",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-04-18T13:00:00.0000000",
"timeZone": "Pacific Standard Time"
}
}
}
]
}