Juan.Queiroz
Juan.Queiroz

Reputation: 227

Delete events from google calendar using api

I'm trying delete events from google calendar using api:

$service->events->delete('primary', 'eventId');

And i got this error:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "Not Found"
   }
  ],
  "code": 404,
  "message": "Not Found"
 }
}

I tried too with api explorer and happens the same error.

Someone knows what's the problem?

Upvotes: 0

Views: 1712

Answers (2)

derive
derive

Reputation: 33

I ran into this problem when copying the piece of code from the documentation. Then I noticed that the method knows nothing about the calendar id.

$service->events->delete('calendarId', 'eventId');

Maybe this helps

Upvotes: 1

Niels
Niels

Reputation: 1330

I ran into a similar problem using python. The two things I did wrong:

  • Make sure your scope is set to 'https://www.googleapis.com/auth/calendar' not the 'readonly' version
  • In python you need to add .execute() at the end of your delete() call. I bet there is something similar in php?

Upvotes: 1

Related Questions