Jump to content

Community edition REST API


markwilliamson101
Go to solution Solved by markwilliamson101,

Recommended Posts

Hi All,

Based on a previous questions anser, I created a report in Jaspersoft Studio and uploaded it to the server. I can see the report and report data now which is a great start for me. 

However, I am trying to test the REST API now but I am only getting a repsonse "resource not found". WIthin the server I can see on the left menu a folder called Reports, just above the themes folder. 
In Reports, I can see my sample report, called Simple_Blue. And when I created the report in 
Jaspersoft Studio, I named the file main_jrxml. So when I was trying to test the REST call, in the hope of getting the data back in pdf or csv I tried adding said extension to the end of the url, like...

http://localhost:8080/jasperserver/rest_v2/reports/reports/simple_blue/main_jrxml.pdf

However, I can not get it to work. I also tried http://localhost:8080/jasperserver/rest_v2/reports/simple_blue/main_jrxml.pdf dropping one of the reports arguments. Does the REST API work in the community edition?

If so, can the REST API return back the reports content in various forms or files? 
Also, if that is possible could the report page itself as well as the REST calls be set up with configurable authentication, date filters or optional paramaters. Ultimatley I would like to make a REST call passing in start dates and end dates along with a optional param and get back a file such as a csv or pdf. 

Any help appreciated. 

Best,

Mark

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

Ok so discovered the name of the file is not needed in the url. From Jasper Server, when you navigate to reports, then right click report to get its properties, there it wil show the path e.g /reports/folder/ReportName

I just use this as the end of the url e.g

http://localhost:8080/jasperserver/rest_v2/reports/reports/folder/ReportName

If you now want said report back in PDF or CSV just add that extension....

http://localhost:8080/jasperserver/rest_v2/reports/reports/folder/ReportName.pdf

URL Query Params also work, these have to be created both as parameters in the report, which are used in the SQL query, and also taken in as a Controls & Resources input control params on the server side. You can do this by editing the report within the server, 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...