2011-02-25 147 views
1

在谷歌帐户我有几个日历,手动管理,例如:会议计划,维护计划。我使用一个帐户创建的日历并查询它们,但是google api已成功。将日历事件添加到特定的日历

但现在我想使用gdata api来管理日历。我想在日历中插入事件,这不是我的默认日历。

文档中说,一个必须添加事件网址

POST https://www.google.com/calendar/feeds/default/private/full

和它的作品,但在我的主日历插件(我主持的登录名命名)。

回答

2

此问题以前已被问过,但找不到具体的帖子。几个月前我遇到了这个问题,解决方案是指定特定日历的网址。你使用的是Python API吗?

service = gdata.calendar.service.CalendarService() 
calendar = gdata.calendar.CalendarListEntry() 
event = gdata.calendar.CalendarEventEntry() 
#here you login, edit the event, and insert the calendar into the service 
url = calendar.content.src 
service.InsertEvent(event, url) 

我做过的一切很简单,因为我不知道你的具体情况,但上面列出的各种功能完整的文档是GDATA文档。重要的部分是找到的网址和使用它在service.InsertEvent()

希望有所帮助。

+1

url = ** calendar.content.src ** 这个粗体字符串完成所有工作!谢谢! – 2011-02-27 22:40:30