I am creating a google add-on for Google Drive. I am using the DriveApp class to access and handle files. I would like to be able to generate a link for downloading a file. Eventually, I want to send this download link to a server for further file processing.
DriveApp's file class appears to have a perfect method for this purpose, file.getDownloadUrl(), which "Gets the URL that can be used to download the file."
Unfortunately, I am seeing some strange behavior and I am not sure if I am using the method correctly.
First, the method returns null when called on Google's filetypes, e.g. application/vnd.google-apps.documentor application/vnd.google-apps.spreadsheet. It makes sense that we may need to set some kind of parameter for what filetype we'd like to export to, but that does not appear to be an option for getDownloadUrl().
Second, when getDownloadUrl() does return a url, access to the url is severely restricted. Unless I am on Chrome and signed into the file owner's G Suite account, I cannot access the file. Signing into the owner account, but browsing on Firefox also returns a 403 error.
I have a flask server running on a set of Drive API credentials. Is there a way to authorize those credentials to access this download link?
Any help would be greatly appreciated!