function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManzaManza 

Help getting reports api column names

Hi I am trying to follow this link (https://www.salesforce.com/docs/developer/pages/Content/pages_compref_analytics_reportChart.htm) in order to get the reports api column names, in order to use some filters however I keep getting the following error
INVALID_SESSION_IDSession expired or invalid
when i try to open the following URL
https://cs6.salesforce.com/services/data/v29.0/analytics/reports/{!myreport}/describe

Is there anyhting that I am missing from the documentations?
Thanks


 
Best Answer chosen by Manza
ManzaManza

Hi Karanraj

Yes I have user my report ID instead of /{!myreport}

I end up running in the developer console the following code:

List <Report> reportList = [SELECT Id,DeveloperName FROM Report where DeveloperName = 'MyReportName'];
String reportId = (String)reportList.get(0).get('Id');
Reports.ReportResults results = Reports.ReportManager.runReport(reportId);
Reports.ReportMetadata rm = results.getReportMetadata();
System.debug('Detail columns: ' + rm.getDetailColumns());

 

All Answers

KaranrajKaranraj
Manaza - Make sure that your instance is CS6 and also replace the {!myreport} in the url into the Id of the of the report.
You can also check the details in https://workbench.developerforce.com/login.php login into the tool and then go to utilities -> REST Explorer

Thanks,
http://karanrajs.com
ManzaManza

Hi Karanraj

Yes I have user my report ID instead of /{!myreport}

I end up running in the developer console the following code:

List <Report> reportList = [SELECT Id,DeveloperName FROM Report where DeveloperName = 'MyReportName'];
String reportId = (String)reportList.get(0).get('Id');
Reports.ReportResults results = Reports.ReportManager.runReport(reportId);
Reports.ReportMetadata rm = results.getReportMetadata();
System.debug('Detail columns: ' + rm.getDetailColumns());

 

This was selected as the best answer