简体   繁体   English

C#Google Calendar API无法删除事件

[英]C# Google calendar API undeletable event

Is there such a thing as undeletable events in google Calendar? 谷歌日历中有不可删除的事件吗? When I execute service.Events.List( "primary" ) I get back 27 entries from MY calendar. 当我执行service.Events.List(“ primary”)时,我从日历中获取了27个条目。 They all have these particulars in common: 它们都有以下共同点:

NO summary, 
NO created date,
NO start date,
NO end date, 
status is cancelled.

When I try to delete them I get an 当我尝试删除它们时,

The service calendar has thrown an exception: Google.GoogleApiException: Google.Apis.Requests.RequestError
Forbidden [403]
Errors [
    Message[Forbidden] Location[ - ] Reason[forbidden] Domain[global]
]

I get the same error if I try to delete the entry id from the Google APIs Explorer in Google Developers. 如果尝试从Google Developers中的Google API Explorer中删除条目ID,则会收到相同的错误。

Any ideas? 有任何想法吗?

Undeletable in a sense that you can't delete the event if you are not the owner of the event. 如果您不是事件的所有者,则无法删除该事件,即无法删除该事件。 I am not a Google Calendar expert but I'll be pointing out some pointer that might help you. 我不是Google日历专家,但我会指出一些可能对您有所帮助的指针。

Forbidden [403]

Are you the one that created the event? 您是创建活动的人吗? Have you passed the correct OAuth value for the request? 您是否为请求传递了正确的OAuth值? According to this document about Authorizing Requests to the Google Calendar API : 根据有关授权对Google Calendar API的请求的文档:

Every request your application sends to the Google Calendar API must include an authorization token. 您的应用程序发送到Google Calendar API的每个请求都必须包含一个授权令牌。 The token also identifies your application to Google. 令牌还会向Google标识您的申请。

For the case of that you have emptied your calendar using the Dashboard, there is a code for getting the deleted items for it. 对于使用仪表板清空日历的情况,有一个代码可以获取已删除的项目。 But in default it is false. 但是默认情况下它是错误的。

showDeleted showDeleted

Whether to include deleted events (with status equals "cancelled") in the result. 结果中是否包括已删除事件(状态等于“已取消”)。 Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. 如果showDeleted和singleEvents均为False,则仍将包括已取消的重复事件实例(但不包括基础重复事件)。 If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. 如果showDeleted和singleEvents均为True,则仅返回已删除事件的单个实例(但不包含基础重复事件)。 Optional. 可选的。 The default is False. 默认值为False。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM