I have an application where I, with a Google Service Account, gather lots of information about my site from the Analytics API. My next step is to create a spreadsheet with the service account and share the document with a couple of users.
I have checked out the documentation at https://developers.google.com/google-apps/spreadsheets/ but I can't find anything there about service accounts and sharing the documents.
So my first question is this possible? If not do I need to implement the "use my personal account" as exemplified in the documentation? If yes could you please provide me with an example?
Thank you!
It is possible, see the example below (the example does need a bit of tweaking):
Create the drive service:
Create the spreadsheet:
Create a spreadsheet service:
Retrieve the sheet:
Add the data:
Also, see this related question