For a script that documents all the spreadsheet files with references in formulas to another spreadsheet, I want to retrieve the last modifying user of a file. This apps script is only being used within the domain I am owning; the spreadsheet documents exist both in MyDrive as in our shared drive.
I am using the following statement:
var docModifierEmail = Drive.Files.get(docId).lastModifyingUser.emailAddress
Documentation is very hard to find The error I'm getting all the time is:
API call to drive.files.get failed with error: File not found: 1Nz0_Kme172EQXAwgW55d7H.....
The scope I am using:
> "oauthScopes": [
> "https://www.googleapis.com/auth/spreadsheets",
> "https://www.googleapis.com/auth/userinfo.email",
> "https://www.googleapis.com/auth/drive",
> "https://www.googleapis.com/auth/drive.activity" <--- not sure if this is needed
Questions that I have:
- Am I using the right function call?
- Am I using the right scope?
- What should be the right statement to retrieve the last modifying user's
email address of the file with id
docId
?