You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Node.js调用Google Calendar API添加Google Meet链接失败求助

解决Google Calendar API添加Google Meet链接失败的问题

错误原因分析

  1. 首次请求(返回200但无会议链接):

    • 错误地在conferenceData下直接定义conferenceSolution,创建Meet链接需要通过createRequest触发API自动生成会议,无需手动指定conferenceSolution。
  2. 第二次请求(返回400错误):

    • 使用了过时的会议类型值"hangoutsMeet",当前Google Calendar API要求Google Meet的类型值为"googleMeet"。

正确的请求代码示例

const response = await calendar.events.patch({
  auth: auth,
  calendarId: calendarId,
  eventId: "6df3sea0jhl6tueoos4qjr41a0",
  requestBody: {
    conferenceData: {
      createRequest: {
        requestId: "unique-request-id-123", // 确保每次请求使用唯一字符串
        conferenceSolutionKey: {
          type: "googleMeet" // 使用正确的会议类型值
        }
      }
    }
  },
  sendNotifications: true,
  conferenceDataVersion: 1 // 必须设置为1,否则会议数据不会被处理
});

额外注意事项

  • requestId唯一性:每次创建会议请求的requestId必须是唯一字符串,避免重复请求引发的异常。
  • 服务账号权限:确保服务账号已被授予https://www.googleapis.com/auth/calendar.events权限,且目标日历已共享给该服务账号(或通过域范围委派获取访问权限)。
  • 客户端库版本:确认使用的Google Calendar API客户端库为最新版本,避免旧版本兼容性问题。

内容的提问来源于stack exchange,提问作者Algorithm Unlock

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 07:05:07