Adding calendar event to specific calendar

百般思念 提交于 2019-12-24 07:20:50

问题


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.

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

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).


回答1:


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)

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

Hope that helps.



来源:https://stackoverflow.com/questions/5114233/adding-calendar-event-to-specific-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!