how to get data from created report using API?

maxim_radetsk
Kilo Explorer

Using the Table API (GET), we can obtain the data from the Incidents table.
Table API (GET) from sys_report table get only the data of the displayed graph in the report (for example "type": "line_bar", "chart_border_color" "," y_axis_title_size ":" 12 ").
How to get data (2017-12-08 = 2 incidents, 2017-12-11 = 1 incident...) from created "Test Report_6" report using API?
60452faaa2c3ab2fe9559084f9d999db

10 REPLIES 10

I have the same need as the OP.  The content of the report will be managed/edited by a person who will not have the resources to change the API consumer.  The API consumer can consume any tabular data in a JSON or XML format, so will not need to be updated if the report is changed.  In my case servicenow reports are for nontechnical users to define a set of data for consumption by joining several tables and choosing specific value to include. I have many nontechnical users who have different reporting needs that will feed the API consumer.

 

I hope this helps.

quiksilver
Mega Guru

Hi Maxim,

 

Did you have any progress on this activity? 

 

I am interested in the solution as I am about to do the same thing if at all possible

 

Thanks

 

Broderick

Generally you'd use the Table API to extract the data but pass filters as part of the query so you don't get ALL data, just a subset of it.

treycarroll
Giga Guru

I have the following use-case.   I need to give API access to a very specific set of data to a service account.  The data must be pulled from a database view which joins two tables.   Since I cannot add filter criteria on the DB View, I'm using a report to add those filters.   I would like to be able to make this resulting table available via API.   The best case scenario would be if I could use normal table API syntax for this report, but I could create my own scripted REST API if there were even any way to "talk" to this report programatically to get the results and return them as JSON.   

maxim.radetsk's use-case is valid.
 
TC

 

Greg Jewett
Kilo Contributor

Please let me know if you @treycarroll or @maxim.radetsk figure this out.  This is exactly what I want to figure out as well!

So a report allows you to bring together al the data from base tables (like cmdb_ci) and all the sub-tables like (cmdb_ci_server), which is really difficult to do in the API without thousands of calls to the API to gather a base list, then calls to sub-tables to find "related" record and grab additional data.

When SNOW can do this for us internally, then use the API to retrieve the data from the report would be fantastic.

HELP!?