0

我正在为 .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);

有什么建议么??谢谢

4

1 回答 1

0

最好开始使用 .net 日历 API V3,因为 V2 已过时,OAuth 1.0 也已过时

于 2013-10-21T09:52:02.830 回答