Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Exception: Request failed for https://www.facebook.com returned code 404. Truncated server response:

Hello guys am stuck with a problem while creating a facebook ads task, am getting an error while i run my code , and the my error is Exception: Request failed for https://www.facebook.com returned code 404. Truncated server response: , if you have any problem please free feel to ask any time.

Error look like

// 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);

}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!