将日历事件添加到特定日历 [英] Adding calendar event to specific calendar

查看:132
本文介绍了将日历事件添加到特定日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google帐户中,我有多个日历,这些日历是手动管理的,例如:会议计划,维护计划.我使用一个帐户创建并查询了这些日历,但是google api成功了.

At google accounts I have several calendars, managed manually, for instance: meeting plan, maintenance plan. This calendars I've created using one account and querying them but google api is successful.

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

But now I want to use gdata api to manage calendars. I want to insert event in calendars which are not my default calendars.

文档说必须向url添加事件

documentation says that a have to add event to url

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

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

And it works, but inserts in my primary calendar (named after my hosted login name).

推荐答案

这个问题曾经被问过,但是我找不到具体的帖子.几个月前我遇到了这个问题,解决方案是指定特定日历的网址.您在使用python API吗?

This question has been asked before but I can't find the specific post. I had this problem a few months ago and the solution is in specifying the url of the specific calendar. Are you using the 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()

I did all that very briefly since I am unaware of your specifics, but the full documentation on the various functions listed above are in the gdata documentation. The important part is finding the url and using it in service.InsertEvent()

希望有帮助.

这篇关于将日历事件添加到特定日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆