I am trying to write a script that automatically deletes old Gmail email. I have it generally working, but after a few days, I get an email with this error message:
Your script, Batch Delete Gmail, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.
Start Function Error Message Trigger End
1/25/21 9:41 AM batchDeleteEmail Authorization is required to perform that action. time-based 1/25/21 9:41 AM
I'm trying to document the process here: https://superuser.com/questions/1618156/how-do-i-automatically-delete-old-google-email-gmail
Unfortunately, I don't really know what I'm doing. I have no experience with Google APIs or the Google Cloud Platform. The only reason I got as far as I have is because I got lucky reading a couple web pages and clicking on things until it started working.
I suspect that I have some kind of temporary "user" (or maybe a test user) that has access for a few days but is then automatically revoked. Unfortunately, I can't remember how I created that user.