繁体   English   中英

GO:“SendUpdates”在使用谷歌日历时不起作用 API

[英]GO : "SendUpdates" not working when using google calendar API

我正在使用GOLANG

我正在尝试使用google-calendar-API向参与者发送通知。

我在calendar package 的文档中尝试了一些功能,其中提到了通过 email 发送通知。 (例如: SendNotifications & SendUpdates

但他们都没有工作。

我已在event结构中附加了与会者,因此那些 email 所有者可以自己在日历板上看到邀请,但不会收到任何 email。

我的部分代码:

创建事件即时:

event := &calendar.Event{
        Summary:     "Google calendar test",
        Location:    "800 Howard St., San Francisco, CA 94103",
        Description: "go hiking!",
        Start: &calendar.EventDateTime{
            DateTime: "2022-01-05T10:00:00",
            TimeZone: "Asia/Taipei",
        },
        End: &calendar.EventDateTime{
            DateTime: "2022-01-05T11:00:00",
            TimeZone: "Asia/Taipei",
        },
        Attendees: []*calendar.EventAttendee{
            &calendar.EventAttendee{Email: "TESTINGGMAIL@gmail.com"},
        },
}

插入事件:

calendarId := "primary"
    event_notification := srv.Events.Insert(calendarId, event).SendUpdates("all")
    event, err = event_notification.Do()

[解决]

对我来说,答案很直接(而且很愚蠢)。

由于我依靠谷歌云平台及其 API(OAuth 的publish status已被我配置为“测试阶段”),我认为它要求与会者也是所有相关事物的Test user要完成。

只需输入您的

Google cloud platform
->hit on the Navigation Menu at the left top
->API's & Services
->OAuth consent screen

并单击“ Test users ”部分下的+ ADD USERS ,然后输入项目中出席者的电子邮件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM