I have an Google Apps Script that runs scheduled to export a spreadsheet as PDF and send it by email. It worked well until some days ago, when it failed with the next error code at the moment of the URL request:
Error en la solicitud para el código devuelto 404 de https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/export?exportFormat=pdf&format=pdf&size=letter&portrait=false&fitw=true&source=labnol&sheetnames=false&printtitle=false&pagenumbers=false&gridlines=false&fzr=false&gid=806009643. Truncated server response ....... etc
It worked pretty well some days ago. Actually, if you take the complete URL and open it in your brwoser, you download the PDF pretty well. But triying to recover it with URLFetchApp as in the code below it fails...
var response = UrlFetchApp.fetch(url + url_ext + ss.getSheetByName("All Languages Charts II").getSheetId(), {
headers: {
'Authorization': 'Bearer ' + token,
}
});
//convert the response to a blob
blob = response.getBlob();
Any hints, tips, or solutions?
Thanks!