将日历事件添加到特定日历

时间:2011-02-25 06:16:04

标签: google-calendar-api

在谷歌帐户中,我有几个日历,手动管理,例如:会议计划,维护计划。我使用一个帐户创建的日历并查询它们但谷歌api成功。

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

文档说必须将事件添加到url

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

它可以工作,但插入我的主日历(以我的托管登录名命名)。

1 个答案:

答案 0 :(得分:2)

之前已经问过这个问题,但我找不到具体的帖子。几个月前我遇到了这个问题,解决方法是指定特定日历的URL。你在使用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文档中。重要的是找到url并在service.InsertEvent()

中使用它

希望有所帮助。

相关问题