Создание события
Статья
10/02/2023
Участники: 16
Обратная связь
В этой статье
Пространство имен: microsoft.graph
Создайте событие в календаре пользователя по умолчанию или указанном календаре.
По умолчанию при создании события для свойства allowNewTimeProposals устанавливается значение true. Это означает, что приглашенные могут предлагать другое время и дату события. Дополнительные сведения о том, как предлагать время, а также получать и принимать новое предложенное время, см. в статье Предложение нового времени собрания .
В рамках этих значений вы можете задать часовой пояс для каждого времени начала или окончания события, так как свойства start и end относятся к типу dateTimeTimeZone . Сначала найдите поддерживаемые часовые пояса , чтобы устанавливать только часовые пояса, настроенные для сервера почтового ящика пользователя.
При отправке события сервер отправляет приглашения всем участникам.
Установка места проведения события
Администратор Exchange может настроить почтовый ящик и адрес электронной почты для ресурса, например конференц-зала, или оборудования, например проектора. Затем пользователи могут пригласить ресурс в качестве участников собрания. Сервер принимает или отклоняет приглашение на собрание от имени ресурса, руководствуясь расписанием его занятости.
Если сервер принимает приглашение от имени ресурса, он создает соответствующее событие в календаре ресурса. В случае переноса собрания сервер автоматически обновляет событие в календаре ресурса.
Еще одно преимущество настройки почтового ящика для ресурса — возможность управления расписанием для ресурса. Например, вы можете разрешить бронирование частного конференц-зала только руководителям и их представителям.
Если вы организуете событие, у которого есть место проведения:
Задайте соответствующее значение для свойства location объекта event .
Задайте необязательное свойство locationEmailAddress , если у места проведения собрания есть адрес электронной почты.
Кроме того, если место проведения собрания было настроено как ресурс или для мероприятия требуется какое-либо оборудование, настроенное как ресурс:
Пригласите ресурс как объект attendee .
Задайте для свойства type участника значение resource
.
Укажите свойство emailAddress участника в качестве электронного адреса ресурса.
Этот API поддерживается в следующих национальных облачных развертываниях .
Глобальная служба
Правительство США L4
Правительство США L5 (DOD)
Китай управляется 21Vianet
✅
✅
✅
✅
Разрешения
Для вызова этого API требуется одно из следующих разрешений. Дополнительные сведения, включая сведения о том, как выбрать разрешения, см. в статье Разрешения .
Тип разрешения
Разрешения (в порядке повышения привилегий)
Делегированные (рабочая или учебная учетная запись)
Calendars.ReadWrite
Делегированные (личная учетная запись Майкрософт)
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
Заголовок
Значение
Авторизация
Bearer {token}. Обязательно.
Content-Type
application/json. Обязательно.
Текст запроса
Предоставьте в тексте запроса описание объекта event в формате JSON.
Так как ресурс event поддерживает расширения , с помощью операции POST
можно добавлять настраиваемые свойства с собственными данными к событию при его создании.
Ответ
В случае успеха этот метод возвращает код ответа 201 Created
и объект event в тексте ответа.
Примеры
Пример 1. Создание события в определенном часовом поясе и назначение событию необязательного значения transactionId
Запрос
Ниже приведен пример запроса. В нем используется заголовок запроса Prefer: outlook.timezone
, чтобы указать часовой пояс для параметров времени начала и окончания в отклике. Он также настраивает свойство transactionId , чтобы сократить количество ненужных повторных попыток на сервере.
POST https://graph.microsoft.com/v1.0/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"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = 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",
};
var result = await graphClient.Me.Events.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users events create --user-id {user-id} --body '{\
"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"\
}\
'
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
configuration := &graphusers.ItemEventsRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphmodels.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "Does noon work for you?"
body.SetContent(&content)
requestBody.SetBody(body)
start := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-04-15T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
requestBody.SetStart(start)
end := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-04-15T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
requestBody.SetEnd(end)
location := graphmodels.NewLocation()
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetLocation(location)
attendee := graphmodels.NewAttendee()
emailAddress := graphmodels.NewEmailAddress()
address := "samanthab@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
name := "Samantha Booth"
emailAddress.SetName(&name)
attendee.SetEmailAddress(emailAddress)
type := graphmodels.REQUIRED_ATTENDEETYPE
attendee.SetType(&type)
attendees := []graphmodels.attendeeable {
attendee,
}
requestBody.SetAttendees(attendees)
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
transactionId := "7E163156-7762-4BEB-A1C6-729EA81755A7"
requestBody.SetTransactionId(&transactionId)
events, err := graphClient.Me().Events().Post(context.Background(), requestBody, configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const event = {
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'
};
await client.api('/me/events')
.post(event);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Event();
$requestBody->setSubject('Let\'s go for lunch');
$body = new ItemBody();
$body->setContentType(new BodyType('hTML'));
$body->setContent('Does noon work for you?');
$requestBody->setBody($body);
$start = new DateTimeTimeZone();
$start->setDateTime('2017-04-15T12:00:00');
$start->setTimeZone('Pacific Standard Time');
$requestBody->setStart($start);
$end = new DateTimeTimeZone();
$end->setDateTime('2017-04-15T14:00:00');
$end->setTimeZone('Pacific Standard Time');
$requestBody->setEnd($end);
$location = new Location();
$location->setDisplayName('Harry\'s Bar');
$requestBody->setLocation($location);
$attendeesAttendee1 = new Attendee();
$attendeesAttendee1EmailAddress = new EmailAddress();
$attendeesAttendee1EmailAddress->setAddress('samanthab@contoso.onmicrosoft.com');
$attendeesAttendee1EmailAddress->setName('Samantha Booth');
$attendeesAttendee1->setEmailAddress($attendeesAttendee1EmailAddress);
$attendeesAttendee1->setType(new AttendeeType('required'));
$attendeesArray []= $attendeesAttendee1;
$requestBody->setAttendees($attendeesArray);
$requestBody->setAllowNewTimeProposals(true);
$requestBody->setTransactionId('7E163156-7762-4BEB-A1C6-729EA81755A7');
$requestConfiguration = new EventsRequestBuilderPostRequestConfiguration();
$headers = [
'Prefer' => 'outlook.timezone="Pacific Standard Time"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->events()->post($requestBody, $requestConfiguration)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = Event(
subject = "Let's go for lunch",
body = ItemBody(
content_type = BodyType.Html,
content = "Does noon work for you?",
),
start = DateTimeTimeZone(
date_time = "2017-04-15T12:00:00",
time_zone = "Pacific Standard Time",
),
end = DateTimeTimeZone(
date_time = "2017-04-15T14:00:00",
time_zone = "Pacific Standard Time",
),
location = Location(
display_name = "Harry's Bar",
),
attendees = [
Attendee(
email_address = EmailAddress(
address = "samanthab@contoso.onmicrosoft.com",
name = "Samantha Booth",
),
type = AttendeeType.Required,
),
]
allow_new_time_proposals = True,
transaction_id = "7E163156-7762-4BEB-A1C6-729EA81755A7",
)
request_configuration = EventsRequestBuilder.EventsRequestBuilderPostRequestConfiguration(
headers = {
'Prefer' : "outlook.timezone=\"Pacific Standard Time\"",
}
)
result = await graph_client.me.events.post(body = request_body, request_configuration = request_configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
Предоставьте в тексте запроса описание объекта event в формате JSON.
Отклик
Ниже приведен пример ответа, где показано, что свойства start и end соответствуют часовому поясу, указанному в заголовке Prefer: outlook.timezone
.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('cd209b0b-3f83-4c35-82d2-d88a61820480')/events/$entity",
"@odata.etag":"W/\"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==\"",
"id":"AAMkAGI1AAAt9AHjAAA=",
"createdDateTime":"2017-04-15T03:00:50.7579581Z",
"lastModifiedDateTime":"2017-04-15T03:00:51.245372Z",
"changeKey":"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==",
"categories":[
],
"originalStartTimeZone":"Pacific Standard Time",
"originalEndTimeZone":"Pacific Standard Time",
"iCalUId":"040000008200E00074C5B7101A82E00800000000DA2B357D94B5D201000000000000000010000000EC4597557F0CB34EA4CC2887EA7B17C3",
"reminderMinutesBeforeStart":15,
"isReminderOn":true,
"hasAttachments":false,
"hideAttendees": false,
"subject":"Let's go brunch",
"bodyPreview":"Does noon work for you?",
"importance":"normal",
"sensitivity":"normal",
"isAllDay":false,
"isCancelled":false,
"isDraft": false,
"isOrganizer":true,
"responseRequested":true,
"seriesMasterId":null,
"transactionId":"7E163156-7762-4BEB-A1C6-729EA81755A7",
"showAs":"busy",
"type":"singleInstance",
"webLink":"https://outlook.office365.com/owa/?itemid=AAMkAGI1AAAt9AHjAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl":null,
"isOnlineMeeting":false,
"onlineMeetingProvider":"unknown",
"onlineMeeting":null,
"allowNewTimeProposals": true,
"responseStatus":{
"response":"organizer",
"time":"0001-01-01T00:00:00Z"
},
"body":{
"contentType":"html",
"content":"<html><head></head><body>Does late morning work for you?</body></html>"
},
"start":{
"dateTime":"2017-04-15T11:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"end":{
"dateTime":"2017-04-15T12:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar",
"locationType": "default",
"uniqueId": "Harry's Bar",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "Harry's Bar",
"locationType": "default",
"uniqueIdType": "unknown"
}
],
"recurrence":null,
"attendees":[
{
"type":"required",
"status":{
"response":"none",
"time":"0001-01-01T00:00:00Z"
},
"emailAddress":{
"name":"Samantha Booth",
"address":"samanthab@contoso.onmicrosoft.com"
}
}
],
"organizer":{
"emailAddress":{
"name":"Dana Swope",
"address":"danas@contoso.onmicrosoft.com"
}
}
}
Пример 2. Создание события, которое происходит в нескольких местах
Запрос
В следующем примере задаются 3 расположения, где организатор и участники могут посетить мероприятие.
Предоставьте в тексте запроса описание объекта event в формате JSON.
POST https://graph.microsoft.com/v1.0/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"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
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = 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.672d,
Longitude = -102.103d,
},
},
new Location
{
DisplayName = "Home Office",
},
},
AllowNewTimeProposals = true,
};
var result = await graphClient.Me.Events.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users events create --user-id {user-id} --body '{\
"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\
}\
'
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
configuration := &graphusers.ItemEventsRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphmodels.NewEvent()
subject := "Plan summer company picnic"
requestBody.SetSubject(&subject)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "Let's kick-start this event planning!"
body.SetContent(&content)
requestBody.SetBody(body)
start := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-08-30T11:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
requestBody.SetStart(start)
end := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-08-30T12:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
requestBody.SetEnd(end)
attendee := graphmodels.NewAttendee()
emailAddress := graphmodels.NewEmailAddress()
address := "DanaS@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
name := "Dana Swope"
emailAddress.SetName(&name)
attendee.SetEmailAddress(emailAddress)
type := graphmodels.REQUIRED_ATTENDEETYPE
attendee.SetType(&type)
attendee1 := graphmodels.NewAttendee()
emailAddress := graphmodels.NewEmailAddress()
address := "AlexW@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
name := "Alex Wilber"
emailAddress.SetName(&name)
attendee1.SetEmailAddress(emailAddress)
type := graphmodels.REQUIRED_ATTENDEETYPE
attendee1.SetType(&type)
attendees := []graphmodels.attendeeable {
attendee,
attendee1,
}
requestBody.SetAttendees(attendees)
location := graphmodels.NewLocation()
displayName := "Conf Room 3; Fourth Coffee; Home Office"
location.SetDisplayName(&displayName)
locationType := graphmodels.DEFAULT_LOCATIONTYPE
location.SetLocationType(&locationType)
requestBody.SetLocation(location)
location := graphmodels.NewLocation()
displayName := "Conf Room 3"
location.SetDisplayName(&displayName)
location1 := graphmodels.NewLocation()
displayName := "Fourth Coffee"
location1.SetDisplayName(&displayName)
address := graphmodels.NewPhysicalAddress()
street := "4567 Main St"
address.SetStreet(&street)
city := "Redmond"
address.SetCity(&city)
state := "WA"
address.SetState(&state)
countryOrRegion := "US"
address.SetCountryOrRegion(&countryOrRegion)
postalCode := "32008"
address.SetPostalCode(&postalCode)
location1.SetAddress(address)
coordinates := graphmodels.NewOutlookGeoCoordinates()
latitude := float64(47.672)
coordinates.SetLatitude(&latitude)
longitude := float64(-102.103)
coordinates.SetLongitude(&longitude)
location1.SetCoordinates(coordinates)
location2 := graphmodels.NewLocation()
displayName := "Home Office"
location2.SetDisplayName(&displayName)
locations := []graphmodels.Locationable {
location,
location1,
location2,
}
requestBody.SetLocations(locations)
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
events, err := graphClient.Me().Events().Post(context.Background(), requestBody, configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const event = {
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
};
await client.api('/me/events')
.post(event);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Event();
$requestBody->setSubject('Plan summer company picnic');
$body = new ItemBody();
$body->setContentType(new BodyType('hTML'));
$body->setContent('Let\'s kick-start this event planning!');
$requestBody->setBody($body);
$start = new DateTimeTimeZone();
$start->setDateTime('2017-08-30T11:00:00');
$start->setTimeZone('Pacific Standard Time');
$requestBody->setStart($start);
$end = new DateTimeTimeZone();
$end->setDateTime('2017-08-30T12:00:00');
$end->setTimeZone('Pacific Standard Time');
$requestBody->setEnd($end);
$attendeesAttendee1 = new Attendee();
$attendeesAttendee1EmailAddress = new EmailAddress();
$attendeesAttendee1EmailAddress->setAddress('DanaS@contoso.onmicrosoft.com');
$attendeesAttendee1EmailAddress->setName('Dana Swope');
$attendeesAttendee1->setEmailAddress($attendeesAttendee1EmailAddress);
$attendeesAttendee1->setType(new AttendeeType('required'));
$attendeesArray []= $attendeesAttendee1;
$attendeesAttendee2 = new Attendee();
$attendeesAttendee2EmailAddress = new EmailAddress();
$attendeesAttendee2EmailAddress->setAddress('AlexW@contoso.onmicrosoft.com');
$attendeesAttendee2EmailAddress->setName('Alex Wilber');
$attendeesAttendee2->setEmailAddress($attendeesAttendee2EmailAddress);
$attendeesAttendee2->setType(new AttendeeType('required'));
$attendeesArray []= $attendeesAttendee2;
$requestBody->setAttendees($attendeesArray);
$location = new Location();
$location->setDisplayName('Conf Room 3; Fourth Coffee; Home Office');
$location->setLocationType(new LocationType('default'));
$requestBody->setLocation($location);
$locationsLocation1 = new Location();
$locationsLocation1->setDisplayName('Conf Room 3');
$locationsArray []= $locationsLocation1;
$locationsLocation2 = new Location();
$locationsLocation2->setDisplayName('Fourth Coffee');
$locationsLocation2Address = new PhysicalAddress();
$locationsLocation2Address->setStreet('4567 Main St');
$locationsLocation2Address->setCity('Redmond');
$locationsLocation2Address->setState('WA');
$locationsLocation2Address->setCountryOrRegion('US');
$locationsLocation2Address->setPostalCode('32008');
$locationsLocation2->setAddress($locationsLocation2Address);
$locationsLocation2Coordinates = new OutlookGeoCoordinates();
$locationsLocation2Coordinates->setLatitude(47.672);
$locationsLocation2Coordinates->setLongitude(-102.103);
$locationsLocation2->setCoordinates($locationsLocation2Coordinates);
$locationsArray []= $locationsLocation2;
$locationsLocation3 = new Location();
$locationsLocation3->setDisplayName('Home Office');
$locationsArray []= $locationsLocation3;
$requestBody->setLocations($locationsArray);
$requestBody->setAllowNewTimeProposals(true);
$requestConfiguration = new EventsRequestBuilderPostRequestConfiguration();
$headers = [
'Prefer' => 'outlook.timezone="Pacific Standard Time"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->events()->post($requestBody, $requestConfiguration)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = Event(
subject = "Plan summer company picnic",
body = ItemBody(
content_type = BodyType.Html,
content = "Let's kick-start this event planning!",
),
start = DateTimeTimeZone(
date_time = "2017-08-30T11:00:00",
time_zone = "Pacific Standard Time",
),
end = DateTimeTimeZone(
date_time = "2017-08-30T12:00:00",
time_zone = "Pacific Standard Time",
),
attendees = [
Attendee(
email_address = EmailAddress(
address = "DanaS@contoso.onmicrosoft.com",
name = "Dana Swope",
),
type = AttendeeType.Required,
),
Attendee(
email_address = EmailAddress(
address = "AlexW@contoso.onmicrosoft.com",
name = "Alex Wilber",
),
type = AttendeeType.Required,
),
]
location = Location(
display_name = "Conf Room 3; Fourth Coffee; Home Office",
location_type = LocationType.Default,
),
locations = [
Location(
display_name = "Conf Room 3",
),
Location(
display_name = "Fourth Coffee",
address = PhysicalAddress(
street = "4567 Main St",
city = "Redmond",
state = "WA",
country_or_region = "US",
postal_code = "32008",
),
coordinates = OutlookGeoCoordinates(
latitude = 47.672,
longitude = -102.103,
),
),
Location(
display_name = "Home Office",
),
]
allow_new_time_proposals = True,
)
request_configuration = EventsRequestBuilder.EventsRequestBuilderPostRequestConfiguration(
headers = {
'Prefer' : "outlook.timezone=\"Pacific Standard Time\"",
}
)
result = await graph_client.me.events.post(body = request_body, request_configuration = request_configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
Отклик
В приведенном ниже примере ответа показано созданное событие, в котором указаны сведения о 3 местах проведения собрания. Так как используется заголовок запроса Prefer: outlook.timezone="Pacific Standard Time"
, свойства start и end выражены в формате PST.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('d1a2fae9-db66-4cc9-8133-2184c77af1b8')/events/$entity",
"@odata.etag":"W/\"y53lbKh6jkaxHzFwGhgyxgAAw5zhug==\"",
"id":"AAMkADAGAADDdm4NAAA=",
"createdDateTime":"2017-08-30T07:06:33.8673345Z",
"lastModifiedDateTime":"2017-08-30T07:06:34.5079772Z",
"changeKey":"y53lbKh6jkaxHzFwGhgyxgAAz3IKMA==",
"categories":[
],
"originalStartTimeZone":"Pacific Standard Time",
"originalEndTimeZone":"Pacific Standard Time",
"iCalUId":"04000000820089190544",
"reminderMinutesBeforeStart":15,
"isReminderOn":true,
"hasAttachments":false,
"hideAttendees": false,
"subject":"Plan summer company picnic",
"bodyPreview":"Let's kick-start this event planning!",
"importance":"normal",
"sensitivity":"normal",
"isAllDay":false,
"isCancelled":false,
"isDraft": false,
"isOrganizer":true,
"responseRequested":true,
"seriesMasterId":null,
"showAs":"busy",
"type":"singleInstance",
"webLink":"https://outlook.office365.com/owa/?itemid=AAMkADAGAADDdm4NAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl":null,
"isOnlineMeeting":true,
"onlineMeetingProvider":"unknown",
"onlineMeeting":null,
"allowNewTimeProposals": true,
"responseStatus":{
"response":"organizer",
"time":"0001-01-01T00:00:00Z"
},
"body":{
"contentType":"html",
"content":"<html>\r\n<head>\r\n</head>\r\n<body>\r\nLet's kick-start this event planning!\r\n</body>\r\n</html>\r\n"
},
"start":{
"dateTime":"2017-08-30T11:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"end":{
"dateTime":"2017-08-30T12:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"location":{
"displayName":"Conf Room 3; Fourth Coffee; Home Office",
"locationType":"default",
"uniqueId":"Conf Room 3; Fourth Coffee; Home Office",
"uniqueIdType":"private"
},
"locations":[
{
"displayName":"Conf Room 3",
"locationType":"default",
"uniqueIdType":"unknown"
},
{
"displayName":"Fourth Coffee",
"locationType":"default",
"uniqueId":"Fourth Coffee",
"uniqueIdType":"private",
"address":{
"street":"4567 Main St",
"city":"Redmond",
"state":"WA",
"countryOrRegion":"US",
"postalCode":"32008"
},
"coordinates":{
"latitude":47.672,
"longitude":-102.103
}
},
{
"displayName":"Home Office",
"locationType":"default",
"uniqueIdType":"unknown"
}
],
"recurrence":null,
"attendees":[
{
"type":"required",
"status":{
"response":"none",
"time":"0001-01-01T00:00:00Z"
},
"emailAddress":{
"name":"Dana Swope",
"address":"DanaS@contoso.onmicrosoft.com"
}
},
{
"type":"required",
"status":{
"response":"none",
"time":"0001-01-01T00:00:00Z"
},
"emailAddress":{
"name":"Alex Wilber",
"address":"AlexW@contoso.onmicrosoft.com"
}
}
],
"organizer":{
"emailAddress":{
"name":"Adele Vance",
"address":"AdeleV@contoso.onmicrosoft.com"
}
}
}
Пример 3: Создание повторяющегося события
Запрос
В третьем примере показано, как создать событие, повторяющееся раз в неделю. Событие происходит с 12:00 до 14:00 каждый понедельник с 4 сентября 2017 г. до конца года.
POST https://graph.microsoft.com/v1.0/me/events
Content-type: application/json
{
"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"
}
],
"allowNewTimeProposals": true
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = 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<DayOfWeekObject?>
{
DayOfWeekObject.Monday,
},
},
Range = new RecurrenceRange
{
Type = RecurrenceRangeType.EndDate,
StartDate = new Date(DateTime.Parse("2017-09-04")),
EndDate = new Date(DateTime.Parse("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,
},
},
AllowNewTimeProposals = true,
};
var result = await graphClient.Me.Events.PostAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users events create --user-id {user-id} --body '{\
"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"\
}\
],\
"allowNewTimeProposals": true\
}\
'
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "Does noon time work for you?"
body.SetContent(&content)
requestBody.SetBody(body)
start := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-09-04T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
requestBody.SetStart(start)
end := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-09-04T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
requestBody.SetEnd(end)
recurrence := graphmodels.NewPatternedRecurrence()
pattern := graphmodels.NewRecurrencePattern()
type := graphmodels.WEEKLY_RECURRENCEPATTERNTYPE
pattern.SetType(&type)
interval := int32(1)
pattern.SetInterval(&interval)
daysOfWeek := []graphmodels.DayOfWeekable {
dayOfWeek := graphmodels.MONDAY_DAYOFWEEK
pattern.SetDayOfWeek(&dayOfWeek)
}
pattern.SetDaysOfWeek(daysOfWeek)
recurrence.SetPattern(pattern)
range := graphmodels.NewRecurrenceRange()
type := graphmodels.ENDDATE_RECURRENCERANGETYPE
range.SetType(&type)
startDate := 2017-09-04
range.SetStartDate(&startDate)
endDate := 2017-12-31
range.SetEndDate(&endDate)
recurrence.SetRange(range)
requestBody.SetRecurrence(recurrence)
location := graphmodels.NewLocation()
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetLocation(location)
attendee := graphmodels.NewAttendee()
emailAddress := graphmodels.NewEmailAddress()
address := "AdeleV@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
name := "Adele Vance"
emailAddress.SetName(&name)
attendee.SetEmailAddress(emailAddress)
type := graphmodels.REQUIRED_ATTENDEETYPE
attendee.SetType(&type)
attendees := []graphmodels.attendeeable {
attendee,
}
requestBody.SetAttendees(attendees)
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
events, err := graphClient.Me().Events().Post(context.Background(), requestBody, nil)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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;
event.allowNewTimeProposals = true;
graphClient.me().events()
.buildRequest()
.post(event);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const event = {
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'
}
],
allowNewTimeProposals: true
};
await client.api('/me/events')
.post(event);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Event();
$requestBody->setSubject('Let\'s go for lunch');
$body = new ItemBody();
$body->setContentType(new BodyType('hTML'));
$body->setContent('Does noon time work for you?');
$requestBody->setBody($body);
$start = new DateTimeTimeZone();
$start->setDateTime('2017-09-04T12:00:00');
$start->setTimeZone('Pacific Standard Time');
$requestBody->setStart($start);
$end = new DateTimeTimeZone();
$end->setDateTime('2017-09-04T14:00:00');
$end->setTimeZone('Pacific Standard Time');
$requestBody->setEnd($end);
$recurrence = new PatternedRecurrence();
$recurrencePattern = new RecurrencePattern();
$recurrencePattern->setType(new RecurrencePatternType('weekly'));
$recurrencePattern->setInterval(1);
$recurrencePattern->setDaysOfWeek([new DayOfWeek('monday'), ]);
$recurrence->setPattern($recurrencePattern);
$recurrenceRange = new RecurrenceRange();
$recurrenceRange->setType(new RecurrenceRangeType('endDate'));
$recurrenceRange->setStartDate(new Date('2017-09-04'));
$recurrenceRange->setEndDate(new Date('2017-12-31'));
$recurrence->setRange($recurrenceRange);
$requestBody->setRecurrence($recurrence);
$location = new Location();
$location->setDisplayName('Harry\'s Bar');
$requestBody->setLocation($location);
$attendeesAttendee1 = new Attendee();
$attendeesAttendee1EmailAddress = new EmailAddress();
$attendeesAttendee1EmailAddress->setAddress('AdeleV@contoso.onmicrosoft.com');
$attendeesAttendee1EmailAddress->setName('Adele Vance');
$attendeesAttendee1->setEmailAddress($attendeesAttendee1EmailAddress);
$attendeesAttendee1->setType(new AttendeeType('required'));
$attendeesArray []= $attendeesAttendee1;
$requestBody->setAttendees($attendeesArray);
$requestBody->setAllowNewTimeProposals(true);
$result = $graphServiceClient->me()->events()->post($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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"
}
)
allowNewTimeProposals = $true
}
# A UPN can also be used as -UserId.
New-MgUserEvent -UserId $userId -BodyParameter $params
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = Event(
subject = "Let's go for lunch",
body = ItemBody(
content_type = BodyType.Html,
content = "Does noon time work for you?",
),
start = DateTimeTimeZone(
date_time = "2017-09-04T12:00:00",
time_zone = "Pacific Standard Time",
),
end = DateTimeTimeZone(
date_time = "2017-09-04T14:00:00",
time_zone = "Pacific Standard Time",
),
recurrence = PatternedRecurrence(
pattern = RecurrencePattern(
type = RecurrencePatternType.Weekly,
interval = 1,
days_of_week = [
DayOfWeek.Monday,
]
),
range = RecurrenceRange(
type = RecurrenceRangeType.EndDate,
start_date = "2017-09-04",
end_date = "2017-12-31",
),
),
location = Location(
display_name = "Harry's Bar",
),
attendees = [
Attendee(
email_address = EmailAddress(
address = "AdeleV@contoso.onmicrosoft.com",
name = "Adele Vance",
),
type = AttendeeType.Required,
),
]
allow_new_time_proposals = True,
)
result = await graph_client.me.events.post(body = request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
Предоставьте в тексте запроса описание объекта event в формате JSON.
Отклик
Ниже приведен пример отклика.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('919717da-0460-4cca-a6be-d25382429896')/events/$entity",
"@odata.etag":"W/\"+T8RDneHMkKe2BGYEaQZ4wAA5a9Acw==\"",
"id":"AAMkADQwMD",
"createdDateTime":"2017-10-07T04:59:12.9698856Z",
"lastModifiedDateTime":"2017-10-07T04:59:13.8136423Z",
"changeKey":"+T8RDneHMkKe2BGYEaQZ4wAA5a9Acw==",
"categories":[
],
"originalStartTimeZone":"Pacific Standard Time",
"originalEndTimeZone":"Pacific Standard Time",
"iCalUId":"040000008200E00074C5B7101A82E0080000000028CEBE04293FD3010000000000000000100000009F85AB8AF8ED4D4FAC777FA89954BDB7",
"reminderMinutesBeforeStart":15,
"isReminderOn":true,
"hasAttachments":false,
"hideAttendees": false,
"subject":"Let's go for lunch",
"bodyPreview":"Does late morning work for you?",
"importance":"normal",
"sensitivity":"normal",
"isAllDay":false,
"isCancelled":false,
"isDraft": false,
"isOrganizer":true,
"responseRequested":true,
"seriesMasterId":null,
"showAs":"busy",
"type":"seriesMaster",
"webLink":"https://outlook.office365.com/owa/?itemid=AAMkADQwMD&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl":null,
"isOnlineMeeting":true,
"onlineMeetingProvider":"unknown",
"onlineMeeting":null,
"allowNewTimeProposals": true,
"responseStatus":{
"response":"organizer",
"time":"0001-01-01T00:00:00Z"
},
"body":{
"contentType":"html",
"content":"<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nDoes late morning work for you?\r\n</body>\r\n</html>\r\n"
},
"start":{
"dateTime":"2017-09-04T12:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"end":{
"dateTime":"2017-09-04T14:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar",
"locationType":"default",
"uniqueId":"Harry's Bar",
"uniqueIdType":"private"
},
"locations":[
{
"displayName":"Harry's Bar",
"locationType":"default",
"uniqueIdType":"unknown"
}
],
"recurrence":{
"pattern":{
"type":"weekly",
"interval":1,
"month":0,
"dayOfMonth":0,
"daysOfWeek":[
"monday"
],
"firstDayOfWeek":"sunday",
"index":"first"
},
"range":{
"type":"endDate",
"startDate":"2017-09-04",
"endDate":"2017-12-31",
"recurrenceTimeZone":"Pacific Standard Time",
"numberOfOccurrences":0
}
},
"attendees":[
{
"type":"required",
"status":{
"response":"none",
"time":"0001-01-01T00:00:00Z"
},
"emailAddress":{
"name":"Adele Vance",
"address":"AdeleV@contoso.onmicrosoft.com"
}
}
],
"organizer":{
"emailAddress":{
"name":"Alex Wilber",
"address":"AlexW@contoso.onmicrosoft.com"
}
},
}
Пример 4. Создание и включение события в виде онлайн-встречи.
Запрос
Вот пример запроса, который создает событие и включает его в качестве онлайн-встречи. Использует заголовок запроса Prefer: outlook.timezone
, чтобы указать часовой пояс для параметров времени start и end в отклике.
POST https://graph.microsoft.com/v1.0/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"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = 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,
};
var result = await graphClient.Me.Events.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users events create --user-id {user-id} --body '{\
"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"\
}\
'
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
configuration := &graphusers.ItemEventsRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphmodels.NewEvent()
subject := "Let's go for lunch"
requestBody.SetSubject(&subject)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "Does noon work for you?"
body.SetContent(&content)
requestBody.SetBody(body)
start := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-04-15T12:00:00"
start.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
start.SetTimeZone(&timeZone)
requestBody.SetStart(start)
end := graphmodels.NewDateTimeTimeZone()
dateTime := "2017-04-15T14:00:00"
end.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
end.SetTimeZone(&timeZone)
requestBody.SetEnd(end)
location := graphmodels.NewLocation()
displayName := "Harry's Bar"
location.SetDisplayName(&displayName)
requestBody.SetLocation(location)
attendee := graphmodels.NewAttendee()
emailAddress := graphmodels.NewEmailAddress()
address := "samanthab@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
name := "Samantha Booth"
emailAddress.SetName(&name)
attendee.SetEmailAddress(emailAddress)
type := graphmodels.REQUIRED_ATTENDEETYPE
attendee.SetType(&type)
attendees := []graphmodels.attendeeable {
attendee,
}
requestBody.SetAttendees(attendees)
allowNewTimeProposals := true
requestBody.SetAllowNewTimeProposals(&allowNewTimeProposals)
isOnlineMeeting := true
requestBody.SetIsOnlineMeeting(&isOnlineMeeting)
onlineMeetingProvider := graphmodels.TEAMSFORBUSINESS_ONLINEMEETINGPROVIDERTYPE
requestBody.SetOnlineMeetingProvider(&onlineMeetingProvider)
events, err := graphClient.Me().Events().Post(context.Background(), requestBody, configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const event = {
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'
};
await client.api('/me/events')
.post(event);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Event();
$requestBody->setSubject('Let\'s go for lunch');
$body = new ItemBody();
$body->setContentType(new BodyType('hTML'));
$body->setContent('Does noon work for you?');
$requestBody->setBody($body);
$start = new DateTimeTimeZone();
$start->setDateTime('2017-04-15T12:00:00');
$start->setTimeZone('Pacific Standard Time');
$requestBody->setStart($start);
$end = new DateTimeTimeZone();
$end->setDateTime('2017-04-15T14:00:00');
$end->setTimeZone('Pacific Standard Time');
$requestBody->setEnd($end);
$location = new Location();
$location->setDisplayName('Harry\'s Bar');
$requestBody->setLocation($location);
$attendeesAttendee1 = new Attendee();
$attendeesAttendee1EmailAddress = new EmailAddress();
$attendeesAttendee1EmailAddress->setAddress('samanthab@contoso.onmicrosoft.com');
$attendeesAttendee1EmailAddress->setName('Samantha Booth');
$attendeesAttendee1->setEmailAddress($attendeesAttendee1EmailAddress);
$attendeesAttendee1->setType(new AttendeeType('required'));
$attendeesArray []= $attendeesAttendee1;
$requestBody->setAttendees($attendeesArray);
$requestBody->setAllowNewTimeProposals(true);
$requestBody->setIsOnlineMeeting(true);
$requestBody->setOnlineMeetingProvider(new OnlineMeetingProviderType('teamsForBusiness'));
$requestConfiguration = new EventsRequestBuilderPostRequestConfiguration();
$headers = [
'Prefer' => 'outlook.timezone="Pacific Standard Time"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->events()->post($requestBody, $requestConfiguration)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
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
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = Event(
subject = "Let's go for lunch",
body = ItemBody(
content_type = BodyType.Html,
content = "Does noon work for you?",
),
start = DateTimeTimeZone(
date_time = "2017-04-15T12:00:00",
time_zone = "Pacific Standard Time",
),
end = DateTimeTimeZone(
date_time = "2017-04-15T14:00:00",
time_zone = "Pacific Standard Time",
),
location = Location(
display_name = "Harry's Bar",
),
attendees = [
Attendee(
email_address = EmailAddress(
address = "samanthab@contoso.onmicrosoft.com",
name = "Samantha Booth",
),
type = AttendeeType.Required,
),
]
allow_new_time_proposals = True,
is_online_meeting = True,
online_meeting_provider = OnlineMeetingProviderType.TeamsForBusiness,
)
request_configuration = EventsRequestBuilder.EventsRequestBuilderPostRequestConfiguration(
headers = {
'Prefer' : "outlook.timezone=\"Pacific Standard Time\"",
}
)
result = await graph_client.me.events.post(body = request_body, request_configuration = request_configuration)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider , см. в документации по SDK .
Предоставьте в тексте запроса описание объекта event в формате JSON.
Отклик
Ниже приведен пример ответа, где показано, что свойства start и end соответствуют часовому поясу, указанному в заголовке Prefer: outlook.timezone
.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('cd209b0b-3f83-4c35-82d2-d88a61820480')/events/$entity",
"@odata.etag":"W/\"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==\"",
"id":"AAMkAGI1AAAt8AHjAAA=",
"createdDateTime":"2017-04-15T03:00:50.7579581Z",
"lastModifiedDateTime":"2017-04-15T03:00:51.245372Z",
"changeKey":"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==",
"categories":[
],
"originalStartTimeZone":"Pacific Standard Time",
"originalEndTimeZone":"Pacific Standard Time",
"iCalUId":"040000008200E00074C5B7101A82E00800000000DA2B357D94B5D201000000000000000010000000EC4597557F0CB34EA4CC2887EA7B17C3",
"reminderMinutesBeforeStart":15,
"isReminderOn":true,
"hasAttachments":false,
"hideAttendees": false,
"subject":"Let's go brunch",
"bodyPreview":"Does noon work for you?",
"importance":"normal",
"sensitivity":"normal",
"isAllDay":false,
"isCancelled":false,
"isDraft": false,
"isOrganizer":true,
"responseRequested":true,
"seriesMasterId":null,
"showAs":"busy",
"type":"singleInstance",
"webLink":"https://outlook.office365.com/owa/?itemid=AAMkAGI1AAAt9AHjAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl":null,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": true,
"responseStatus":{
"response":"organizer",
"time":"0001-01-01T00:00:00Z"
},
"body":{
"contentType":"html",
"content":"<html><head></head><body>Does late morning work for you?</body></html>"
},
"start":{
"dateTime":"2017-04-15T11:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"end":{
"dateTime":"2017-04-15T12:00:00.0000000",
"timeZone":"Pacific Standard Time"
},
"location": {
"displayName": "Harry's Bar",
"locationType": "default",
"uniqueId": "Harry's Bar",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "Harry's Bar",
"locationType": "default",
"uniqueIdType": "unknown"
}
],
"recurrence":null,
"attendees":[
{
"type":"required",
"status":{
"response":"none",
"time":"0001-01-01T00:00:00Z"
},
"emailAddress":{
"name":"Samantha Booth",
"address":"samanthab@contoso.onmicrosoft.com"
}
}
],
"organizer":{
"emailAddress":{
"name":"Dana Swope",
"address":"danas@contoso.onmicrosoft.com"
}
},
"onlineMeeting": {
"joinUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_NzIyNzhlMGEtM2YyZC00ZmY0LTlhNzUtZmZjNWFmZGNlNzE2%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%22bc55b173-cff6-457d-b7a1-64bda7d7581a%22%7d",
"conferenceId": "177513992",
"tollNumber": "+1 425 555 0123"
}
}
См. также