google-calendar-api - 如何让通过 Google Calendar API 创建的事件发送邀请电子邮件?

标签 google-calendar-api

我正在尝试通过 API 创建一个事件,并且它大部分都在工作,除了在受邀者日历中创建新事件时,没有发送电子邮件。

从 Web 界面创建事件是插入事件通过,以及发送电子邮件(除了一个根本没有收到任何通知的帐户,但这与我当前的问题无关)。

我试图插入的事件是:

<entry xmlns='http://www.w3.org/2005/Atom'
    xmlns:gd='http://schemas.google.com/g/2005'>
  <category scheme='http://schemas.google.com/g/2005#kind'
    term='http://schemas.google.com/g/2005#event'></category>
  <title type='text'>test event</title>
  <content type='text'>content.</content>
  <gd:transparency
    value='http://schemas.google.com/g/2005#event.opaque'>
  </gd:transparency>
  <gd:eventStatus
    value='http://schemas.google.com/g/2005#event.confirmed'>
  </gd:eventStatus>
  <gd:where valueString='somewhere'></gd:where>
  <gd:who email="[redacted]" rel='http://schemas.google.com/g/2005#event.attendee' valueString='Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'/></gd:who>
  <gd:who email="[redacted again]" rel='http://schemas.google.com/g/2005#event.organizer' valueString='Also Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'/></gd:who>
  <gd:when startTime='2010-05-18T15:30:00.000+10:00'
    endTime='2010-05-18T16:00:00.000+10:00'></gd:when>
</entry>

当我请求事件列表时,我看不到通过 API 创建的事件和通过 Web 界面创建的事件之间有任何大的差异。

编辑:身份验证是通过用户名/密码而不是 AuthSub 或 OAuth,但我怀疑这是否相关

最佳答案

根据 Trevor's message in this thread我在追求(记录不佳)gCal:sendEventNotifications属性(在我的示例中,需要扩展 <entry> 节点以包含 gCal 命名空间,因此示例变为:

<entry xmlns='http://www.w3.org/2005/Atom'
    xmlns:gd='http://schemas.google.com/g/2005'
    xmlns:gCal='http://schemas.google.com/gCal/2005'>
  <category scheme='http://schemas.google.com/g/2005#kind'
    term='http://schemas.google.com/g/2005#event'></category>
  <title type='text'>test event</title>
  <content type='text'>content.</content>
  <gd:transparency
    value='http://schemas.google.com/g/2005#event.opaque'>
  </gd:transparency>
  <gd:eventStatus
    value='http://schemas.google.com/g/2005#event.confirmed'>
  </gd:eventStatus>
  <gd:where valueString='somewhere'></gd:where>
  <gCal:sendEventNotifications value='true'></gCal:sendEventNotifications>
  <gd:who email="[redacted]" rel='http://schemas.google.com/g/2005#event.attendee' valueString='Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'/></gd:who>
  <gd:who email="[redacted again]" rel='http://schemas.google.com/g/2005#event.organizer' valueString='Also Me'><gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'/></gd:who>
  <gd:when startTime='2010-05-18T15:30:00.000+10:00'
    endTime='2010-05-18T16:00:00.000+10:00'></gd:when>
</entry>

关于google-calendar-api - 如何让通过 Google Calendar API 创建的事件发送邀请电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2846515/

相关文章:

c# - 在 Google 日历 API 中导入/导出 .ical

php - 刷新 OAuth2 token @ Google_CalendarServices 时出错 (php)

ios - 将 Google Calendar API 集成到应用程序中?

c++ - 在 C++ 中解析 iCal/vCal/Google 日历文件

javascript - 使用javascript将日期字符串转换为不同的格式

firebase - Google 日历 API 和 Google 应用程序验证流程

php - 谷歌日历 API : Cannot get Google Meet link for newly created event with service account access in PHP

Java:谷歌日历 API

spring-boot - Spring Boot 社交登录和 Google Calendar API

ios - 想在谷歌日历中添加事件