我需要通过MS Graph API从用户日历还原事件,而无需将通知发送给与会者。问题在于创建事件后,它将自动向所有参与者发送电子邮件,无论是新事件还是旧事件。我只想创建活动而不发送任何电子邮件。我还尝试添加了ResponseRequested = false和responseStatus = None属性,但是它什么也没做。
我找不到任何方法来控制它。创建事件应包含一个布尔值,以启用一个“将通知发送给参加者”选项,如果该选项为false,则它将不发送日历邀请给参加者,否则发送。
以下是请求的示例:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @event = new Event
{
Subject = "Let's go for lunch",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Does mid month work for you?"
},
Start = new DateTimeTimeZone
{
DateTime = "2019-03-15T12:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2019-03-15T14:00:00",
TimeZone = "Pacific Standard Time"
},
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.Calendars["AAMkAGViNDU7zAAAAAGtlAAA="].Events
.Request()
.AddAsync(@event);
https://docs.microsoft.com/en-us/graph/api/calendar-post-events?view=graph-rest-1.0&tabs=csharp