Google api 在google calendar API v3中插入新的calendarEntry将返回404

Google api 在google calendar API v3中插入新的calendarEntry将返回404,google-api,google-calendar-api,google-api-java-client,Google Api,Google Calendar Api,Google Api Java Client,我使用google api services日历v3 for java 我可以毫无问题地列出我的日历条目。但是插入新的calendarEntry失败 我使用与示例相同的代码: CalendarListEntry newCal = new CalendarListEntry(); newCal.setId(calTitle); newCal.setSummary(calTitle); newCal.setTimeZone("Europe/Paris"); CalendarListEntry exe

我使用google api services日历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"
 }
}
CONFIG:{“id”:“A_测试”、“摘要”:“A_测试”、“时区”:“欧洲/巴黎”}
2012年10月15日16:20:45 com.google.api.client.http.HttpRequest执行
配置:------------请求--------------
邮递https://www.googleapis.com/calendar/v3/users/me/calendarList
接受编码:gzip
授权:
用户代理:谷歌HTTP Java客户端/1.10.2-beta(gzip)
内容类型:application/json;字符集=UTF-8
内容编码:gzip
内容长度:69
配置:总计:60字节
配置:{“id”:“A_测试”,“摘要”:“A_测试”,“时区”:“欧洲/巴黎”}
2012年10月15日16:20:46 com.google.api.client.http.HttpResponse
配置:-------------响应--------------
未找到HTTP/1.1 404
X-Frame-Options:SAMEORIGIN
日期:2012年6月15日星期五14:07:52 GMT
内容长度:120
到期时间:2012年6月15日星期五14:07:52 GMT
X-XSS-Protection:1;模式=块
内容编码:gzip
内容类型:application/json;字符集=UTF-8
伺服器:GSE
缓存控制:专用,最大年龄=0
X-Content-Type-Options:nosniff
配置:总计:165字节
配置:{
“错误”:{
“错误”:[
{
“域”:“全局”,
“原因”:“未找到”,
“消息”:“未找到”
}
],
“代码”:404,
“消息”:“未找到”
}
}
有什么想法吗?

RTFM

我没上好大学。正确的插入必须打开

而不是

代码是:

    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();
    }

您好,您能告诉我如何在谷歌日历中插入活动吗?我不明白。如果您有一些代码,请发送给我。我有谷歌api的示例代码,但无法理解。此URL开关使用最新的Python api为我修复了它。你知道为什么不正确的URL会被广告吗?您是否参考了上述“手册”?