Answers.Body: <p>This might be tricky because the export csv button actually runs functions to compile the file and force the download using php header() and content-disposition attachment. See line 224 etc here to look at how it is working: <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php</a>.</p>
  
  <p>You could probably write an extension that invokes the functions to generate the csv based on what's going on here. Or perhaps one exists?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-27T21:22:57.270Z
Answers.LastActivityDate: 2017-02-27T21:22:57.270Z
Answers.UserDisplayName: Eli Lisseck
Body: <p>I'm using CiviCRM as a WordPress plugin. I've created a report with a URL like:</p>
  
  <p><a href="https://example.com/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/report/instance/123" rel="nofollow noreferrer">https://example.com/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/report/instance/123</a></p>
  
  <p>I can visit that page and click the "Export CSV" button. Now, I want to write a script with the Google Sheets API that loads this CSV and updates a Google Sheet. Therefore, I need a direct link to the CSV-formatted report, so my script can issue an HTTP GET and receive the CSV data.</p>
  
  <p>Is there a URL parameter I can pass, or some other way to directly link to the CSV?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T16:20:33.200Z
Comments.Text: Not really an answer but this might be tricky because the export csv button actually runs functions to compile the file and force the download using php header() and content-disposition attachment. See line 224 etc here to look at how it is working: https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php. You could probably write an extension that invokes the functions to generate the csv based on what's going on here. Or perhaps one exists?
Comments.UserDisplayName: Eli Lisseck
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-27T21:15:14.590Z
Comments.Text: Thanks, that seems like an authoritative "No". If you submit your comment as an answer instead I'll accept it, thank you.
Comments.UserDisplayName: A. Jesse Jiryu Davis
Tags: <civireport><urls>
Title: Direct link to a CSV-formatted report
ThreadText: # Direct link to a CSV-formatted report
  
  (Asked by: username_0 on 2017-02-26)
  
  I'm using CiviCRM as a WordPress plugin. I've created a report with a URL like:
  
  <https://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/report/instance/123>
  
  I can visit that page and click the "Export CSV" button. Now, I want to write a script with the Google Sheets API that loads this CSV and updates a Google Sheet. Therefore, I need a direct link to the CSV-formatted report, so my script can issue an HTTP GET and receive the CSV data.
  
  Is there a URL parameter I can pass, or some other way to directly link to the CSV?
  
  **Tags:** civireport, urls
  
  > **Comments:**
  > **username_1**: Not really an answer but this might be tricky because the export csv button actually runs functions to compile the file and force the download using php header() and content-disposition attachment. See line 224 etc here to look at how it is working: https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php. You could probably write an extension that invokes the functions to generate the csv based on what's going on here. Or perhaps one exists?  
  > **username_0**: Thanks, that seems like an authoritative "No". If you submit your comment as an answer instead I'll accept it, thank you.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-02-27. Score: 1 | Accepted answer
  
  This might be tricky because the export csv button actually runs functions to compile the file and force the download using php header() and content-disposition attachment. See line 224 etc here to look at how it is working: <https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Report.php>.
  
  You could probably write an extension that invokes the functions to generate the csv based on what's going on here. Or perhaps one exists?
  
  
  ---
  
  