Fetching all data from the API within a domain via the administrator account

50 views
Skip to first unread message

Paul

unread,
Jan 24, 2022, 11:17:51 AMJan 24
to Google Apps Script Community
Hi all,

Within Workplace there are several apps: doc, cal, sheet, presentation.

When users use these services all interactions are stored and the API provides access to gather this data. 

I know you can retract all data via the user account itself but I'm curious if the administrator has access to all activities being done by all the users in the same domain.

For instance:

User X updates a presentation.
User Y creates a document,
User Q makes a cal appoint with external domain.

I want to collect these touchpoints and create a feed of these for the company. 

Thanks in advance!

dimud...@gmail.com

unread,
Jan 25, 2022, 1:44:14 PMJan 25
to Google Apps Script Community
Don't have the time to walk you through the specifics but I can give you some info to start your search.
Look up Domain-wide Delegation of Authority for GCP cloud projects; basically you can set up a GCP project with a service account that can impersonate any account in your domain and use the service account credentials to access a user's data. You can uses Eric Koleda's OAuth2 library to interact with service accounts from GAS.

Employees might find that above approach invasive or a touch creepy, so a more conscientious and easier alternative is to setup a workflow around Shared drives (https://developers.google.com/drive/api/v3/about-shareddrives). Create a shared drive with folders for specific content and your domain users can then create files in those shared drive folders from their accounts and you can monitor them programmatically using the Drive API. 

Paul

unread,
Jan 30, 2022, 5:36:15 AMJan 30
to Google Apps Script Community
Thank you so much!

Paul

unread,
Feb 2, 2022, 10:17:17 AMFeb 2
to Google Apps Script Community
Would the second approach also work in google cal, docs, etc, not just with drive?

On Tuesday, 25 January 2022 at 19:44:14 UTC+1 dimud...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages