I am wondering to know is there any way to add multiple reminders for calendar event in Microsoft graph API. By default it sets 15 minutes before reminder for event. My requirement is for multiple reminders like 1 day before, 12 hours before and 1 hour before event starts. I am using graph API SDK in .NET core. Thanks!
CodePudding user response:
Graph API calendar event resource type inherits from event resource type which has a property reminderMinutesBeforeStart
. It's the number of minutes before the event start time that the reminder alert occurs.
So, you can't have multiple reminders.
What you can do is to call snooze reminder to postpone a reminder for an event in a user calendar until a new time.
Not sure how reminders works for instance in Outlook Client but you need a background process to check events on a regular interval, looking for events that require a reminder and snooze reminder.
Example to get a list of event reminders in a user calendar within the specified start and end times:
var reminderView = await graphClient.Me
.ReminderView("2022-03-15T10:00:00.0000000","2022-03-15T11:00:00.0000000")
.Request()
.GetAsync();
Example to snooze reminder:
var newReminderTime = new DateTimeTimeZone
{
DateTime = "dateTime-value",
TimeZone = "timeZone-value"
};
await graphClient.Me.Events["{event-id}"]
.SnoozeReminder(newReminderTime)
.Request()
.PostAsync();