+ Start a Discussion
Tal CohenTal Cohen 

Creating a report via Report API

I want to programmatically create a report with several filters, and I'm not sure how to correctly do this via Report API.
Note : The report type (objects returned in the report) are dynamically chosen by the user, so I don't know in advance whether this is going to be a report on Leads \ Opportunities \ Accounts \ Custom object etc.

My options as far as I see :
   - Use the QUERY method to run a report - but then, how can I save this report for later use? (Documentation says it's not saved)
   - Create a dummy report manually, then use PATCH method to change an existing report - tried this, but it seems I cannot change the reportType field (I get an error saying "INVALID COLUMN" when trying to change an Opportunities report  to a Leads Report

Am I missing something?