Hola chicos, tengo un problema al crear una tarea de anuncios de Facebook, recibo un error mientras ejecuto mi código y mi error es Excepción: la solicitud falló para https://www.facebook.com devolvió el código 404. Respuesta del servidor truncada : , si tiene algún problema, no dude en preguntar en cualquier momento.
// MODIFY YOUR SETTINGS HERE // // url of the google sheets where the report will be const SPREADSHEET_URL = 'https://docs.google.com/spreadsheets/d/1h-9f2Au7pBLUTpkOaSEPHJoEN61PQxnlQjczyz6_icU/edit#gid=0' // name of the sheet where the report will be const TAB_NAME = 'Facebook' // DO NOT MODIFY ANYTHING BELOW // function getFacebookReport() { // Selects the chosen sheet and tab const ss = SpreadsheetApp.openByUrl(SPREADSHEET_URL); const sheet = ss.getSheetByName(TAB_NAME); // Clears the sheet sheet.clear(); // Gets the Facebook report run ID const cache = CacheService.getScriptCache(); const reportId = cache.get('campaign-report-id'); // Fetches the report as a csv file const url = `https://www.facebook.com/ads/ads_insights/export_report?report_run_id=${reportId}&format=csv&access_token=${TOKEN}`; const fetchRequest = UrlFetchApp.fetch(url); const results = Utilities.parseCsv(fetchRequest); // Pastes the csv file in the sheet sheet.getRange(1,1, results.length, results[0].length).setValues(results); }