I'll skip the details on why, but I have several hundred mbox files stored in Google Drive containing hundreds of thousands of messages that I need to extract the MessageID from. However, I keep getting the following error when I try to access the contents of any of these mbox files:
You do not have authorization to perform that action.
This is in a script that I have already used to gather other information on the files (size, number of files, etc.) and I've already been faced with the standard "This script needs your authorization to run" dialog.
I always seem to get it when I try to get access the Blob as something I can actually use. For example, in my test code below I get the error on
var file = DriveApp.getFileById('longFileIdStringGoesHere');
var fileContents = file.getAs('application/mbox');
I've tried all sorts of character encoding and various File.getAs types to try and read the contents of the file, but I always run into that authorization error. I am the owner of the files. Am I missing something?