The Google oauth2client library changed how credentials were managed, replacing SignedJwtAssertionCredentials with oauth2client.service_account.ServiceAccountCredentials. This was covered in https://github.com/google/oauth2client/issues/401 and I've followed the steps provided by dhermes to use a PEM file with the new code to authenticate.
Reading https://developers.google.com/identity/protocols/OAuth2ServiceAccount, it mentions the use of:
delegated_credentials = credentials.create_delegated('[email protected]')
which I've also added to my code but I don't know where to use delegated_credentials and the documentation doesn't give a sample.
The main bit of my script that creates the calendar event is thus:
created_event = service.events().insert(calendarId=CALENDAR, body=event).execute()
and it is there that I'm getting the 404 error. However, if I use Google's API tester and copy/paste the same calendar ID and the JSON that my script generates, the API works.
All I've changed in my script is the authentication code, but I'm not getting an authentication error response. The script was working prior to Google's API change and I'm using Google's Python library to interface with their API.
Any suggestions on what I need to look at to fix this?