Asp.net 通过.net api在谷歌日历中设置提醒

Asp.net 通过.net api在谷歌日历中设置提醒,asp.net,google-api,google-calendar-api,Asp.net,Google Api,Google Calendar Api,我正在写一个asp.net网页,在谷歌日历中创建事件。我想为活动添加一个“通知”,在活动开始前30分钟发送一封电子邮件。 通过阅读api,我发现有一个属性用于插入名为“提醒”的事件,这似乎是相同的。使用谷歌的api游乐场,我可以成功创建事件并指定提醒。 但是,使用.net api版本1.9.0.990,我可以创建事件,但没有为其设置提醒。以下是我编写的代码: Shared Sub eventWithReminder(calendarIdentifier As String, startTime

我正在写一个asp.net网页,在谷歌日历中创建事件。我想为活动添加一个“通知”,在活动开始前30分钟发送一封电子邮件。 通过阅读api,我发现有一个属性用于插入名为“提醒”的事件,这似乎是相同的。使用谷歌的api游乐场,我可以成功创建事件并指定提醒。 但是,使用.net api版本1.9.0.990,我可以创建事件,但没有为其设置提醒。以下是我编写的代码:

Shared Sub eventWithReminder(calendarIdentifier As String, startTime As DateTime, endTime As DateTime, eventTitle As String)
    Dim calendarID As String


    Dim calList As CalendarList = RoomReservations_RoomReservationsServiceAccount.calService.CalendarList.List().Execute
    For Each Calendar In calList.Items
        If Calendar.Id = calendarIdentifier Then
            calendarID = Calendar.Id
        End If
    Next

    Dim anotherNewEvent As New [Event]
    anotherNewEvent.Summary = eventTitle
    Dim edtStart As New EventDateTime
    edtStart.DateTime = startTime
    Dim edtEnd As New EventDateTime
    edtEnd.DateTime = endTime
    anotherNewEvent.Start = edtStart
    anotherNewEvent.End = edtEnd

    Dim reminder As New EventReminder
    reminder.Method = "email"
    reminder.Minutes = 30
    Dim reminderList As New List(Of EventReminder)
    reminderList.Add(reminder)
    Dim remindData As New [Event].RemindersData
    remindData.UseDefault = False
    remindData.Overrides = reminderList
    anotherNewEvent.Reminders = remindData

    System.Net.ServicePointManager.Expect100Continue = False

    RoomReservations_RoomReservationsServiceAccount.calService.Events.Insert(anotherNewEvent, calendarID).Execute()

End Sub
然后,我在google日历web界面中查看事件,但通知部分显示“未设置通知”

这个功能还没有内置到api中吗?
如果是,我是否使用不正确?

提醒与经过身份验证的用户绑定。在本例中,Bob使用服务帐户创建事件,但在用户的日历上。服务帐户没有修改用户提醒的权限


要更改某人的提醒,您需要作为此人进行身份验证(使用其Oauth令牌)。

dotnet库支持提醒。看看这里的答案:@luc我尝试了你链接的答案中的代码,但结果相同。该事件是在google日历中创建的,但其中没有设置提醒。如果您正确设置UseDefaults=false,那么您是否可能使用一个帐户插入事件,并使用另一个帐户读取事件?你介意粘贴整个代码吗?我没有阅读代码中的事件。我在google日历web界面中检查事件。我将用更多信息更新我的问题。事实上,您正在检查事件的帐户是否与您用于插入事件的帐户相同?