我正在为 .net 使用 google api 2.0。我使用此代码创建一个新日历:
CalendarEntry calendar = new CalendarEntry();
calendar.Title.Text = "Little League Schedule";
calendar.Summary.Text = "This calendar contains the practice schedule and game times.";
calendar.TimeZone = "America/Los_Angeles";
calendar.Hidden = false;
calendar.Color = "#2952A3";
calendar.Location = new Where("", "", "Oakland");
Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/owncalendars/full");
CalendarEntry createdCalendar = (CalendarEntry) service.Insert(postUri, calendar);
但是,在执行时,返回错误:
请求执行失败
在线
CalendarEntry createdCalendar = (CalendarEntry) service.Insert(postUri, calendar);
但是,如果我使用浏览器连接到谷歌日历,则会创建新日历。
此外,我使用此代码来检索所有日历并且它有效
CalendarQuery query = new CalendarQuery();
query.Uri = new Uri("https://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = (CalendarFeed) service.Query(query);
有什么建议么??谢谢