C# 使用Google日历API设置事件作者
我试图在将事件添加到Google日历时使用以下代码设置作者:C# 使用Google日历API设置事件作者,c#,.net,google-api,google-calendar-api,C#,.net,Google Api,Google Calendar Api,我试图在将事件添加到Google日历时使用以下代码设置作者: CalendarService service = new CalendarService("TestApp"); service.setUserCredentials("example@gmail.com", "1234"); EventEntry entry = new EventEntry(); // Set the title and content of t
CalendarService service = new CalendarService("TestApp");
service.setUserCredentials("example@gmail.com", "1234");
EventEntry entry = new EventEntry();
// Set the title and content of the entry.
entry.Title.Text = "Test";
entry.Content.Content = "Test";
// Not working
AtomPerson author = new AtomPerson(AtomPersonType.Author);
author.Name = "John Doe";
author.Email = "john@example.com";
entry.Authors.Add(author);
When eventTime = new When(activity.Start, activity.End, activity.Start == activity.End ? true : false);
entry.Times.Add(eventTime);
Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/private/full");
// Send the request and receive the response:
AtomEntry insertedEntry = service.Insert(postUri, entry);
事件将添加除作者之外的所有正确属性。作者仍然是日历的所有者。有什么想法吗?根据日历API文档(http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#CreatingSingle): 服务器将根据用户插入作者信息 提交请求(即,其身份验证令牌 随请求一起) 创建事件时,无法设置“作者”字段的值