How to automate a Google Apps Script when Oauth2.0 credentials are required
I am using the Google Postmaster Tools API to get some Google Sheet reports using Google Apps Script. I had to create a project in Google Cloud to get the Oauth 2.0 credentials and so far so good, I run the script and get the data on the google sheet.
The problem is that if I try to automate it – the script must start itself once a week – I get no errors but neither do I get the data written on the sheet, and I think it depends on the fact that for authentication it is always necessary to copy the url as shown here