I have some legacy Java code which uses the V2 Google spreadsheet API to read values from one Google spreadsheet, retrieve some DB values and do some calcs, and update a second Google spreadsheet. With the imminent cutover to OAuth2 authentication only, I need to migrate to the V3 API.
This process gets run from the command line, so the assumption would be that using a service account and a P12 key would be the way forward -- and indeed, we are doing that for using the Google Calendar service.
But it doesn't seem like there is support in place for the spreadsheet service for service accounts. I've seen older references (~2 years ago) to Google Data APIs supporting OAuth2 service accounts through the setOAuth2Credentials()
method, but that does not seem to be true today.
Has anyone had any luck in getting the V3 spreadsheet API working with an OAuth2 service account in Java, or can point me to recent (~within the last year) code samples?