この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
Calendars.ReadWrite
委任 (個人用 Microsoft アカウント)
Calendars.ReadWrite
アプリケーション
Calendars.ReadWrite
HTTP 要求
POST /me/events
POST /users/{id | userPrincipalName}/events
POST /me/calendar/events
POST /users/{id | userPrincipalName}/calendar/events
POST /me/calendars/{id}/events
POST /users/{id | userPrincipalName}/calendars/{id}/events
POST https://graph.microsoft.com/beta/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"transactionId":"7E163156-7762-4BEB-A1C6-729EA81755A7"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @event = new Event
{
Subject = "Let's go for lunch",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Does noon work for you?"
},
Start = new DateTimeTimeZone
{
DateTime = "2017-04-15T12:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2017-04-15T14:00:00",
TimeZone = "Pacific Standard Time"
},
Location = new Location
{
DisplayName = "Harry's Bar"
},
Attendees = new List<Attendee>()
{
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "samanthab@contoso.onmicrosoft.com",
Name = "Samantha Booth"
},
Type = AttendeeType.Required
}
},
AllowNewTimeProposals = true,
TransactionId = "7E163156-7762-4BEB-A1C6-729EA81755A7"
};
await graphClient.Me.Events
.Request()
.Header("Prefer","outlook.timezone=\"Pacific Standard Time\"")
.AddAsync(@event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("Prefer", "outlook.timezone=\"Pacific Standard Time\""));
Event event = new Event();
event.subject = "Let's go for lunch";
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "Does noon work for you?";
event.body = body;
DateTimeTimeZone start = new DateTimeTimeZone();
start.dateTime = "2017-04-15T12:00:00";
start.timeZone = "Pacific Standard Time";
event.start = start;
DateTimeTimeZone end = new DateTimeTimeZone();
end.dateTime = "2017-04-15T14:00:00";
end.timeZone = "Pacific Standard Time";
event.end = end;
Location location = new Location();
location.displayName = "Harry's Bar";
event.location = location;
LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();
Attendee attendees = new Attendee();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "samanthab@contoso.onmicrosoft.com";
emailAddress.name = "Samantha Booth";
attendees.emailAddress = emailAddress;
attendees.type = AttendeeType.REQUIRED;
attendeesList.add(attendees);
event.attendees = attendeesList;
event.allowNewTimeProposals = true;
event.transactionId = "7E163156-7762-4BEB-A1C6-729EA81755A7";
graphClient.me().events()
.buildRequest( requestOptions )
.post(event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
requestBody.SetBody(body)
contentType := "HTML"
body.SetContentType(&contentType)
content := "Does noon work for you?"
body.SetContent(&content)
start := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetStart(start)
dateTime := "2017-04-15T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
end := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetEnd(end)
dateTime := "2017-04-15T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
location := msgraphsdk.NewLocation()
requestBody.SetLocation(location)
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetAttendees( []Attendee {
msgraphsdk.NewAttendee(),
SetAdditionalData(map[string]interface{}{
"type": "required",
}
}
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
transactionId := "7E163156-7762-4BEB-A1C6-729EA81755A7"
requestBody.SetTransactionId(&transactionId)
headers := map[string]string{
"Prefer": "outlook.timezone="Pacific Standard Time""
}
options := &msgraphsdk.EventsRequestBuilderPostRequestConfiguration{
Headers: headers,
}
result, err := graphClient.Me().Events().PostWithRequestConfigurationAndResponseHandler(requestBody, options, nil)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Calendar
$params = @{
Subject = "Let's go for lunch"
Body = @{
ContentType = "HTML"
Content = "Does noon work for you?"
}
Start = @{
DateTime = "2017-04-15T12:00:00"
TimeZone = "Pacific Standard Time"
}
End = @{
DateTime = "2017-04-15T14:00:00"
TimeZone = "Pacific Standard Time"
}
Location = @{
DisplayName = "Harry's Bar"
}
Attendees = @(
@{
EmailAddress = @{
Address = "samanthab@contoso.onmicrosoft.com"
Name = "Samantha Booth"
}
Type = "required"
}
)
AllowNewTimeProposals = $true
TransactionId = "7E163156-7762-4BEB-A1C6-729EA81755A7"
}
# A UPN can also be used as -UserId.
New-MgUserEvent -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @event = new Event
{
Subject = "Plan summer company picnic",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Let's kick-start this event planning!"
},
Start = new DateTimeTimeZone
{
DateTime = "2017-08-30T11:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2017-08-30T12:00:00",
TimeZone = "Pacific Standard Time"
},
Attendees = new List<Attendee>()
{
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "DanaS@contoso.onmicrosoft.com",
Name = "Dana Swope"
},
Type = AttendeeType.Required
},
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "AlexW@contoso.onmicrosoft.com",
Name = "Alex Wilber"
},
Type = AttendeeType.Required
}
},
Location = new Location
{
DisplayName = "Conf Room 3; Fourth Coffee; Home Office",
LocationType = LocationType.Default
},
Locations = new List<Location>()
{
new Location
{
DisplayName = "Conf Room 3"
},
new Location
{
DisplayName = "Fourth Coffee",
Address = new PhysicalAddress
{
Street = "4567 Main St",
City = "Redmond",
State = "WA",
CountryOrRegion = "US",
PostalCode = "32008"
},
Coordinates = new OutlookGeoCoordinates
{
Latitude = 47.672,
Longitude = -102.103
}
},
new Location
{
DisplayName = "Home Office"
}
},
AllowNewTimeProposals = true
};
await graphClient.Me.Events
.Request()
.Header("Prefer","outlook.timezone=\"Pacific Standard Time\"")
.AddAsync(@event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("Prefer", "outlook.timezone=\"Pacific Standard Time\""));
Event event = new Event();
event.subject = "Plan summer company picnic";
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "Let's kick-start this event planning!";
event.body = body;
DateTimeTimeZone start = new DateTimeTimeZone();
start.dateTime = "2017-08-30T11:00:00";
start.timeZone = "Pacific Standard Time";
event.start = start;
DateTimeTimeZone end = new DateTimeTimeZone();
end.dateTime = "2017-08-30T12:00:00";
end.timeZone = "Pacific Standard Time";
event.end = end;
LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();
Attendee attendees = new Attendee();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "DanaS@contoso.onmicrosoft.com";
emailAddress.name = "Dana Swope";
attendees.emailAddress = emailAddress;
attendees.type = AttendeeType.REQUIRED;
attendeesList.add(attendees);
Attendee attendees1 = new Attendee();
EmailAddress emailAddress1 = new EmailAddress();
emailAddress1.address = "AlexW@contoso.onmicrosoft.com";
emailAddress1.name = "Alex Wilber";
attendees1.emailAddress = emailAddress1;
attendees1.type = AttendeeType.REQUIRED;
attendeesList.add(attendees1);
event.attendees = attendeesList;
Location location = new Location();
location.displayName = "Conf Room 3; Fourth Coffee; Home Office";
location.locationType = LocationType.DEFAULT;
event.location = location;
LinkedList<Location> locationsList = new LinkedList<Location>();
Location locations = new Location();
locations.displayName = "Conf Room 3";
locationsList.add(locations);
Location locations1 = new Location();
locations1.displayName = "Fourth Coffee";
PhysicalAddress address2 = new PhysicalAddress();
address2.street = "4567 Main St";
address2.city = "Redmond";
address2.state = "WA";
address2.countryOrRegion = "US";
address2.postalCode = "32008";
locations1.address = address2;
OutlookGeoCoordinates coordinates = new OutlookGeoCoordinates();
coordinates.latitude = 47.672d;
coordinates.longitude = -102.103d;
locations1.coordinates = coordinates;
locationsList.add(locations1);
Location locations2 = new Location();
locations2.displayName = "Home Office";
locationsList.add(locations2);
event.locations = locationsList;
event.allowNewTimeProposals = true;
graphClient.me().events()
.buildRequest( requestOptions )
.post(event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Calendar
$params = @{
Subject = "Plan summer company picnic"
Body = @{
ContentType = "HTML"
Content = "Let's kick-start this event planning!"
}
Start = @{
DateTime = "2017-08-30T11:00:00"
TimeZone = "Pacific Standard Time"
}
End = @{
DateTime = "2017-08-30T12:00:00"
TimeZone = "Pacific Standard Time"
}
Attendees = @(
@{
EmailAddress = @{
Address = "DanaS@contoso.onmicrosoft.com"
Name = "Dana Swope"
}
Type = "Required"
}
@{
EmailAddress = @{
Address = "AlexW@contoso.onmicrosoft.com"
Name = "Alex Wilber"
}
Type = "Required"
}
)
Location = @{
DisplayName = "Conf Room 3; Fourth Coffee; Home Office"
LocationType = "Default"
}
Locations = @(
@{
DisplayName = "Conf Room 3"
}
@{
DisplayName = "Fourth Coffee"
Address = @{
Street = "4567 Main St"
City = "Redmond"
State = "WA"
CountryOrRegion = "US"
PostalCode = "32008"
}
Coordinates = @{
Latitude = 47.672
Longitude = -102.103
}
}
@{
DisplayName = "Home Office"
}
)
AllowNewTimeProposals = $true
}
# A UPN can also be used as -UserId.
New-MgUserEvent -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @event = new Event
{
Subject = "Let's go for lunch",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Does noon time work for you?"
},
Start = new DateTimeTimeZone
{
DateTime = "2017-09-04T12:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2017-09-04T14:00:00",
TimeZone = "Pacific Standard Time"
},
Recurrence = new PatternedRecurrence
{
Pattern = new RecurrencePattern
{
Type = RecurrencePatternType.Weekly,
Interval = 1,
DaysOfWeek = new List<DayOfWeek>()
{
DayOfWeek.Monday
}
},
Range = new RecurrenceRange
{
Type = RecurrenceRangeType.EndDate,
StartDate = new Date(2017,9,4),
EndDate = new Date(2017,12,31)
}
},
Location = new Location
{
DisplayName = "Harry's Bar"
},
Attendees = new List<Attendee>()
{
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "AdeleV@contoso.onmicrosoft.com",
Name = "Adele Vance"
},
Type = AttendeeType.Required
}
}
};
await graphClient.Me.Events
.Request()
.AddAsync(@event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Event event = new Event();
event.subject = "Let's go for lunch";
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "Does noon time work for you?";
event.body = body;
DateTimeTimeZone start = new DateTimeTimeZone();
start.dateTime = "2017-09-04T12:00:00";
start.timeZone = "Pacific Standard Time";
event.start = start;
DateTimeTimeZone end = new DateTimeTimeZone();
end.dateTime = "2017-09-04T14:00:00";
end.timeZone = "Pacific Standard Time";
event.end = end;
PatternedRecurrence recurrence = new PatternedRecurrence();
RecurrencePattern pattern = new RecurrencePattern();
pattern.type = RecurrencePatternType.WEEKLY;
pattern.interval = 1;
LinkedList<DayOfWeek> daysOfWeekList = new LinkedList<DayOfWeek>();
daysOfWeekList.add(DayOfWeek.MONDAY);
pattern.daysOfWeek = daysOfWeekList;
recurrence.pattern = pattern;
RecurrenceRange range = new RecurrenceRange();
range.type = RecurrenceRangeType.END_DATE;
range.startDate = new DateOnly(1900,1,1);
range.endDate = new DateOnly(1900,1,1);
recurrence.range = range;
event.recurrence = recurrence;
Location location = new Location();
location.displayName = "Harry's Bar";
event.location = location;
LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();
Attendee attendees = new Attendee();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "AdeleV@contoso.onmicrosoft.com";
emailAddress.name = "Adele Vance";
attendees.emailAddress = emailAddress;
attendees.type = AttendeeType.REQUIRED;
attendeesList.add(attendees);
event.attendees = attendeesList;
graphClient.me().events()
.buildRequest()
.post(event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
requestBody.SetBody(body)
contentType := "HTML"
body.SetContentType(&contentType)
content := "Does noon time work for you?"
body.SetContent(&content)
start := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetStart(start)
dateTime := "2017-09-04T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
end := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetEnd(end)
dateTime := "2017-09-04T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
recurrence := msgraphsdk.NewPatternedRecurrence()
requestBody.SetRecurrence(recurrence)
pattern := msgraphsdk.NewRecurrencePattern()
recurrence.SetPattern(pattern)
type := "weekly"
pattern.SetType(&type)
interval := int32(1)
pattern.SetInterval(&interval)
pattern.SetDaysOfWeek( []DayOfWeek {
"Monday",
}
range := msgraphsdk.NewRecurrenceRange()
recurrence.SetRange(range)
type := "endDate"
range.SetType(&type)
startDate := "2017-09-04"
range.SetStartDate(&startDate)
endDate := "2017-12-31"
range.SetEndDate(&endDate)
location := msgraphsdk.NewLocation()
requestBody.SetLocation(location)
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetAttendees( []Attendee {
msgraphsdk.NewAttendee(),
SetAdditionalData(map[string]interface{}{
"type": "required",
}
}
result, err := graphClient.Me().Events().Post(requestBody)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Calendar
$params = @{
Subject = "Let's go for lunch"
Body = @{
ContentType = "HTML"
Content = "Does noon time work for you?"
}
Start = @{
DateTime = "2017-09-04T12:00:00"
TimeZone = "Pacific Standard Time"
}
End = @{
DateTime = "2017-09-04T14:00:00"
TimeZone = "Pacific Standard Time"
}
Recurrence = @{
Pattern = @{
Type = "weekly"
Interval = 1
DaysOfWeek = @(
"Monday"
)
}
Range = @{
Type = "endDate"
StartDate = "2017-09-04"
EndDate = "2017-12-31"
}
}
Location = @{
DisplayName = "Harry's Bar"
}
Attendees = @(
@{
EmailAddress = @{
Address = "AdeleV@contoso.onmicrosoft.com"
Name = "Adele Vance"
}
Type = "required"
}
)
}
# A UPN can also be used as -UserId.
New-MgUserEvent -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
POST https://graph.microsoft.com/beta/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @event = new Event
{
Subject = "Let's go for lunch",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Does noon work for you?"
},
Start = new DateTimeTimeZone
{
DateTime = "2017-04-15T12:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2017-04-15T14:00:00",
TimeZone = "Pacific Standard Time"
},
Location = new Location
{
DisplayName = "Harry's Bar"
},
Attendees = new List<Attendee>()
{
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "samanthab@contoso.onmicrosoft.com",
Name = "Samantha Booth"
},
Type = AttendeeType.Required
}
},
AllowNewTimeProposals = true,
IsOnlineMeeting = true,
OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness
};
await graphClient.Me.Events
.Request()
.Header("Prefer","outlook.timezone=\"Pacific Standard Time\"")
.AddAsync(@event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("Prefer", "outlook.timezone=\"Pacific Standard Time\""));
Event event = new Event();
event.subject = "Let's go for lunch";
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "Does noon work for you?";
event.body = body;
DateTimeTimeZone start = new DateTimeTimeZone();
start.dateTime = "2017-04-15T12:00:00";
start.timeZone = "Pacific Standard Time";
event.start = start;
DateTimeTimeZone end = new DateTimeTimeZone();
end.dateTime = "2017-04-15T14:00:00";
end.timeZone = "Pacific Standard Time";
event.end = end;
Location location = new Location();
location.displayName = "Harry's Bar";
event.location = location;
LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();
Attendee attendees = new Attendee();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "samanthab@contoso.onmicrosoft.com";
emailAddress.name = "Samantha Booth";
attendees.emailAddress = emailAddress;
attendees.type = AttendeeType.REQUIRED;
attendeesList.add(attendees);
event.attendees = attendeesList;
event.allowNewTimeProposals = true;
event.isOnlineMeeting = true;
event.onlineMeetingProvider = OnlineMeetingProviderType.TEAMS_FOR_BUSINESS;
graphClient.me().events()
.buildRequest( requestOptions )
.post(event);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
requestBody.SetBody(body)
contentType := "HTML"
body.SetContentType(&contentType)
content := "Does noon work for you?"
body.SetContent(&content)
start := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetStart(start)
dateTime := "2017-04-15T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
end := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetEnd(end)
dateTime := "2017-04-15T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
location := msgraphsdk.NewLocation()
requestBody.SetLocation(location)
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetAttendees( []Attendee {
msgraphsdk.NewAttendee(),
SetAdditionalData(map[string]interface{}{
"type": "required",
}
}
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
isOnlineMeeting := true
requestBody.SetIsOnlineMeeting(&isOnlineMeeting)
onlineMeetingProvider := "teamsForBusiness"
requestBody.SetOnlineMeetingProvider(&onlineMeetingProvider)
headers := map[string]string{
"Prefer": "outlook.timezone="Pacific Standard Time""
}
options := &msgraphsdk.EventsRequestBuilderPostRequestConfiguration{
Headers: headers,
}
result, err := graphClient.Me().Events().PostWithRequestConfigurationAndResponseHandler(requestBody, options, nil)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Calendar
$params = @{
Subject = "Let's go for lunch"
Body = @{
ContentType = "HTML"
Content = "Does noon work for you?"
}
Start = @{
DateTime = "2017-04-15T12:00:00"
TimeZone = "Pacific Standard Time"
}
End = @{
DateTime = "2017-04-15T14:00:00"
TimeZone = "Pacific Standard Time"
}
Location = @{
DisplayName = "Harry's Bar"
}
Attendees = @(
@{
EmailAddress = @{
Address = "samanthab@contoso.onmicrosoft.com"
Name = "Samantha Booth"
}
Type = "required"
}
)
AllowNewTimeProposals = $true
IsOnlineMeeting = $true
OnlineMeetingProvider = "teamsForBusiness"
}
# A UPN can also be used as -UserId.
New-MgUserEvent -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。