We have created a Service Account in Google and Using Calendar API for adding events, it worked fine before ,after google stopped the account and reactivated it , it didn\'t
remember that the following code inserts your events into the service accounts primary calendar
var recurringEvent = service.Events.Insert(myEvent, "primary");
In order to see these events you will need to either do an events.list or invite someone else to the event so that they can see it in their own calendar.
Beyond that there is currently an issue on the forums about invites not being sent https://issuetracker.google.com/issues/140746812
In the past few weeks, my team have the same issues, and this is what my team's workaround.
Our scenario
google-calendar@mycompany.iam.gserviceaccount.com
calendar.events.insert({
calendarId: 'primary', // it will create an event into service account's calendar
resource: data,
sendNotifications: true
})
What we have done for a workaround.
system@mycompany.com
)system@mycompany.com
's calendar with a service account by
google-calendar@mycompany.iam.gserviceaccount.com
with "Make changes to events"calendar.events.insert({
calendarId: 'system@mycompany.com', // << we changed from 'primary' to just-created-user
resource: data,
sendNotifications: true
})
After changing it, the created-event will be shown in Google Calendar as what it should.
Hope this helps