Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
307 views
in Technique[技术] by (71.8m points)

What is the meaning of Google Calendar API Delete 410 error

I'm trying to delete an event from one of my Google calendars using the Java API. They code looks like:

calendarService.events().delete( calendarId , eventId ).execute();

When I do so, I get the error:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 410 Gone
DELETE https://www.googleapis.com/calendar/v3/calendars/[email protected]/events/jm1gamo1cj3dm68bidsaufffdg
{
  "code" : 410,
  "errors" : [ {
    "domain" : "global",
    "message" : "Resource has been deleted",
    "reason" : "deleted"
  } ],
  "message" : "Resource has been deleted"
}

I can't figure out what the message is telling me.

Is it saying the event wasn't found? If so, the wording seems odd - why wouldn't it say "not found".

Or, is it saying it was deleted previously where the event is marked as deleted (a logical deletion) but still remains in the system (thus it knows it was previously deleted) possibly queued for a physical deletion?

question from:https://stackoverflow.com/questions/65896050/what-is-the-meaning-of-google-calendar-api-delete-410-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

According to the Calendar API documentation here:

410: Gone

SyncToken or updatedMin parameters are no longer valid. This error can also occur if a request attempts to delete an event that has already been deleted.

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "deleted",
    "message": "Resource has been deleted"
   }
  ],
  "code": 410,
  "message": "Resource has been deleted"
 }
}

So, if you already deleted an event and you try to delete it again, you will most likely be getting this error message.

Reference


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...