在 Google 日历 API v3 中插入​​新的 calendarEntry 返回 404

2024-04-15

我使用 google-api-services-calendar v3 for java。

我毫无问题地列出了我的日历条目。但是插入新的calendarEntry失败。

我使用与示例相同的代码:

CalendarListEntry newCal = new CalendarListEntry();
newCal.setId(calTitle);
newCal.setSummary(calTitle);
newCal.setTimeZone("Europe/Paris");
CalendarListEntry execute = null;
try {
    execute = service.calendarList().insert(newCal).execute();
} catch (IOException e) {
    e.printStackTrace();
}

未创建日历。在日志中我有:

CONFIG: {"id":"A_TEST","summary":"A_TEST","timeZone":"Europe/Paris"}
15 juin 2012 16:20:45 com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST  --------------
POST https://www.googleapis.com/calendar/v3/users/me/calendarList
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: Google-HTTP-Java-Client/1.10.2-beta (gzip)
Content-Type: application/json; charset=UTF-8
Content-Encoding: gzip
Content-Length: 69

CONFIG: Total: 60 bytes
CONFIG: {"id":"A_TEST","summary":"A_TEST","timeZone":"Europe/Paris"}
15 juin 2012 16:20:46 com.google.api.client.http.HttpResponse <init>
CONFIG: -------------- RESPONSE --------------
HTTP/1.1 404 Not Found
X-Frame-Options: SAMEORIGIN
Date: Fri, 15 Jun 2012 14:07:52 GMT
Content-Length: 120
Expires: Fri, 15 Jun 2012 14:07:52 GMT
X-XSS-Protection: 1; mode=block
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Server: GSE
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff

CONFIG: Total: 165 bytes
CONFIG: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "Not Found"
   }
  ],
  "code": 404,
  "message": "Not Found"
 }
}

有任何想法吗?


RTFM!

我不在好的uri上。正确插入必须打开https://www.googleapis.com/calendar/v3/calendars https://www.googleapis.com/calendar/v3/calendars

and not https://www.googleapis.com/calendar/v3/users/me/calendarList https://www.googleapis.com/calendar/v3/users/me/calendarList.

代码是:

    Calendar newCal = new Calendar();
    newCal.setSummary(calTitle);
    newCal.setTimeZone("Europe/Paris");

    Calendar createdCalendar = null;
    try {
        createdCalendar = service.calendars().insert(newCal).execute();
    } catch (Exception e){
        e.printStackTrace();
    }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Google 日历 API v3 中插入​​新的 calendarEntry 返回 404 的相关文章

  • StorageServiceAccountSample 应用程序报告“未找到 KeyStore JKS 实现”

    第一行存储服务帐户示例 http samples google api java client googlecode com hg storage serviceaccount cmdline sample instructions htm
  • Android Firebase 将多个帐户提供商与匹配的电子邮件链接起来

    在我的 firebase 仪表板中我设置了multiple accounts for one email option 我的应用程序中有简单的电子邮件 Facebook 和 Google Plus 身份验证 我在 LoginActivity
  • Google Analytics 3.0 身份验证流程

    EDIT 最初这个问题问我如何仅使用我的 API 密钥通过 Google Analytics API 进行身份验证 作为弗拉特科指出 https stackoverflow com a 13834210 697449 这是不可能的 现在我只
  • 信任 Google API 响应对象和所有权

    我已经在我的网络应用程序中成功实现了 Google Login 使用适用于客户端 Web 应用程序的 OAuth 2 0 https developers google com identity protocols OAuth2UserAg
  • 我正在尝试导入 GoogleAPIClient 或 GoogleAPIClientForREST

    我正在努力追随谷歌的教程 https developers google com drive ios quickstart ver swift制作他们的 QuickStart 应用程序来学习如何使用 Swift 进行 API 调用 我完全按
  • Google Tasks API:403 禁止,超出服务限制

    您好 Google Tasks API 团队 从几天前开始 我们就开始 403 Forbidden 对于我们的许多用户来说 您能检查一下发生了什么事吗 我们的 API 控制台很干净 calls 远低于配额 Caused by com goo
  • Google Calendar API - 不获取重复事件实例

    我正在尝试使用 V3 API 从 Google 日历获取所有事件 我注意到有关重复事件的问题 对于某些日历上的某些重复事件 仅获取第一个实例 例如 获取总共 8 个实例中的前 5 个实例 一些额外的细节 我已经仔细检查查询日期范围是否正确
  • YouTube API v3 示例项目引发 GTLJSONRPCErrorDomain -32602 错误请求错误

    我刚刚下载了Google API 目标 C 客户端 https code google com p google api objectivec client source checkout 我在 Mac 上的 Xcode 中打开了 YouT
  • 电子表格的授权范围

    我创建了一个独立的 Google Apps 脚本 它不属于任何文档 该脚本会以固定的时间间隔自动触发 这个脚本 创建几个文件夹 如果它们不存在 创建一个 Google 电子表格 如果不存在 读过说 电子表格 更新日历事件 我注意到 当我第一
  • 如何在 Google 日历中创建“recurData”?

    我想使用 Google API 创建日历的重复事件 我正在关注链接 谷歌日历API http code google com apis calendar data 2 0 developers guide dotnet html Creat
  • 从 Google Chat POST 请求验证 JWT

    我有一个 NodeJS 机器人使用 HTTPs 端点连接到 Google Chat 我正在使用快递来接收请求 我需要验证所有请求是否都来自 Google 并且希望使用 Google 随请求发送的不记名令牌来执行此操作 我的问题是我正在努力寻
  • Google 服务帐户用户界面

    我怎样才能登录谷歌服务帐户 https developers google com identity protocols OAuth2ServiceAccount使用普通的网络用户界面 例如谷歌驱动器 https www google co
  • 如何使用 ASP.Net Core Identity 从登录用户检索 Google 个人资料图片?

    好的 我目前正在使用 ASP NET Core 1 1 2 和 ASP NET Core Identity 1 1 2 其中重要的部分是启动 cs看起来像这样 public void Configure IApplicationBuilde
  • cron 爬虫使用 Ruby 中的 Google API 将数据插入 Google 电子表格的授权问题

    我的项目是每天早上 9 00 抓取某些网络数据并将它们放入我的 Google 电子表格中 并且它必须获得读取和写入某些内容的授权 这就是为什么下面的代码位于顶部 Google API CLIENT ID blah blah CLIENT S
  • 从 google Drive 自行下载 xlsx 文件

    所以 我正在尝试制作一个小脚本 它将使用谷歌驱动器API下载一个Excel文件 通过遵循谷歌API教程 我遇到了两个错误 无法读取未定义的 on 属性 和 请求的转换是不支持 这是代码 const fs require fs const r
  • 无法实施第三方 Google 日历会议插件

    我正在研究 Google 日历会议插件的实施并发现了一些问题 我按照文档执行示例代码 但它没有按预期工作 从我的角度来看 我的清单文件是完整的 但是当我尝试从 从清单部署 链接发布日历会议插件时 它会打开我的谷歌日历 但它不会显示我的会议
  • 指向特定工作表的超链接

    我想从另一个电子表格中的超链接打开 Google 表格的特定工作表 我的主电子表格中有不同的链接 每个链接都应该有一个指向同一从属电子表格但指向不同工作表的超链接 我知道超链接功能 但它不会转到特定的工作表 您可以使用此自定义脚本 工具 g
  • Google javascript 登录 api:无法离线访问

    我正在尝试为服务器端应用程序实现 Google 登录 如 Google 文档中所示 服务器端应用程序的 Google 登录 https developers google com identity sign in web server si
  • 如果浏览器关闭,GoogleWebAuthorizationBroker.AuthorizeAsync() 会挂起

    我正在编写一个 C 桌面应用程序 可以将其输出复制到用户的 Google Drive 但是 当我尝试使用 GoogleWebAuthorizationBroker AuthorizeAsync 授权访问 Google 时 如果用户关闭浏览器
  • 互动卡环聊 Api

    我正在使用交互式卡将消息异步发送到环聊聊天 API 并且使用了 onClick action 但是当我执行该操作并单击按钮时 我收到此错误 CARD CLICKED ERROR 并不是我通过将 actionResponse 添加到 a 来处

随机推荐