简体   繁体   中英

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

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.

Forbidden [403]

Are you the one that created the event? Have you passed the correct OAuth value for the request? According to this document about Authorizing Requests to the Google Calendar API :

Every request your application sends to the Google Calendar API must include an authorization token. The token also identifies your application to 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

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. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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