Fanda OG
Fanda OG

Reputation: 21

How can I get deleted events from primary calendar (in GSuit) via API?

I want to get deleted events via Google api. I use this code:

$events = self::getCalendarService()->events->listEvents(self::getCalendarService()->calendars->get('primary'), ["showDeleted" => true]);

Everything works fine in my private Google account. But if I try this in our GSuit Google Calendar I can not see deleted events. This is only for primary calendar in GSuit. If I create new calendar in GSuit and delete an event then I get the deleted event.

How do I get this problem:

  1. Sing in into my GSuite account
  2. select primary calendar
  3. create a new event in calendar
  4. check if I can see the new event via API (and I see the new event)
  5. delete the new event via Google Calendar web
  6. check if I can see the new event after delete via API (with ["showDeleted" => true]) and I can not see the new event (I can see the new event after delete in my private Google account or if do not use primary calendar)

How can I get deleted events for GSuite primary calendar?

Thank you.

Upvotes: 1

Views: 373

Answers (1)

ziganotschka
ziganotschka

Reputation: 26836

Either you can see deleted events or not on a shared calendar, depends how a calendar is shared with you

See here:

Important: Anyone who has "Make changes to events" or "Make changes AND manage sharing" permission for the calendar can delete events and see and restore events from that calendar's trash.

In other words, if you can see deleted events in your private / primary calendar, but not in domain calendars that have been shared with you - it means that you do not have the necessary privelleges to access this inforamtion

Upvotes: 0

Related Questions