More Related Content Similar to Back to [Jaspersoft] Basics: Rest API 101 (20) More from TIBCO Jaspersoft (20) Back to [Jaspersoft] Basics: Rest API 1012. © Copyright 2000-2017 TIBCO Software Inc. 2
What are we talking about?
Then
Your app
Analytics
Consumer
Now
Embedded BI
Put answers
in context
Increase
adoption of BI
Give consumers
actionable data
3. © Copyright 2000-2017 TIBCO Software Inc.
What APIs does Jaspersoft have?
Not
Integrated
RESTful API iFrame
Integration
JavaScript
API
Separate portal for
reporting & analytics
Mass reporting &
administration
Integration as
separate app
Seamless, in-page
analytics
AnalyticsApplication
4. © Copyright 2000-2014 TIBCO Software Inc.
4
What is a RESTful API?
•http://server.com/rest_v2URL
•weather/san_franciscoServices
•PUT, POST,GET,DELETEVerbs
•JSON
•XML
Representations
REST API is an Application Programming Interface that follows the guidelines of
REpresentational State Transfer design. It communicates with the server through the
HTTP protocol. Client applications send requests to named URLs that are called
services using verbs and sending and receiving payloads in different
representations.
6. Fast access to All
Jasper Reports
Server functionality
© Copyright 2000-2017 TIBCO Software Inc.
8. Big variety of client
application libraries
ready to integrate
required REST API
© Copyright 2000-2017 TIBCO Software Inc.
10. Who is using REST API?
© Copyright 2000-2017 TIBCO Software Inc.
API is how programs communicate between each other
Inside any app
or process
Delivery
Your app
REST
API
12. © Copyright 2000-2017 TIBCO Software Inc.
Authentication
JRS support various ways how to authenticate to the server
Application
Authenticate using Pre-Authentication Token
HTTP Basic Authentication
Login service which returns Session ID
Login using SSO Token
13. © Copyright 2000-2017 TIBCO Software Inc.
Repository resources
Resource creation: reports, folders, files, etc.
Resource update
Resource removal
Set and update permissions
Import and Export Resources
Run reports and generate output files
Schedule Report execution
Access to all repository resources
14. © Copyright 2000-2017 TIBCO Software Inc.
Multi Tenant Environment
Manage (create/update/remove) Organizations, Users, Roles
Set Profile Attributes
State = CA State = NV State = WA
16. Demo Topics. 3 common use cases
Search Repository Object
Run Report
Schedule Report Execution
19. © Copyright 2000-2017 TIBCO Software Inc.
Search Repository
http://localhost:8080/jasperserver-
pro/rest_v2/resources?type=reportUnit&folderUri=/publi
c&q=Account {
"resourceLookup": [
{
"version": 0,
"permissionMask": 1,
"creationDate": "2017-04-28T16:06:12",
"updateDate": "2013-10-03T16:17:06",
"label": "05g. Accounts Report",
"description": "Basic interactive Table
Component report with alternate color scheme.",
"uri":
"/public/Samples/Reports/5g.AccountsReport",
"resourceType": "reportUnit"
}
...
}
20. © Copyright 2000-2017 TIBCO Software Inc.
Run a report in two ways
Synchronously
Asynchronously
Run
Generate
Download
Change
Report Options
Check Status
Download
Generate
Run
21. © Copyright 2000-2017 TIBCO Software Inc.
Run a report
Synchronously
http://localhost:8080/jasperserver-pro/rest_v2/reports
/public/Samples/Reports/5g.AccountsReport.pdf
22. © Copyright 2000-2017 TIBCO Software Inc.
Run a report
Asynchronously
Method: POST
{
"status": "ready",
"totalPages": 46,
"requestId": "b619fbd2-c40e-4138-945b-10a3d8a37b63”,
"reportURI": "/public/Samples/Reports/5g.AccountsReport"
}
http://localhost:8080/jasperserver-pro/rest_v2/reportExecutions
Content-Type: application/json
Body:
{“reportUnitUri” : “/public/Samples/Reports/5g.AccountReport”}
23. © Copyright 2000-2017 TIBCO Software Inc.
Asynchronously generate export file
http://localhost:8080/jasperserver-
pro/rest_v2/reportExecutions/b619fbd2-c40e-4138-945b-
10a3d8a37b63
Method: GET
{
"status": "ready",
"totalPages": 46,
"requestId": "d60427b0-0df7-4e73-bec4-91251e31708f",
"reportURI": "/public/Samples/Reports/5g.AccountsReport",
"exports": [
{
"id": "239c0187-bed9-4840-8d72-598845db802d",
"status": "ready",
"outputResource": {
"contentType": "application/pdf",
"fileName": "5g.AccountsReport.pdf",
…
24. © Copyright 2000-2017 TIBCO Software Inc.
Asynchronously download the output file
http://localhost:8080/jasperserver-
pro/rest_v2/reportExecutions/b619fbd2-c40e-4138-945b-
10a3d8a37b63/exports/239c0187-bed9-4840-8d72-
598845db802d/outputResource
Method: GET
25. © Copyright 2000-2017 TIBCO Software Inc.
Schedule a report
http://localhost:8080/jasperserv
er-pro/rest_v2/jobs/
Method: PUT
Schedule a report to be executed twice and every 1 minute
Body {…}
26. © Copyright 2000-2017 TIBCO Software Inc.
Scheduler capabilities
• Search for a particular job
• Get job by it’s id
• Check the job status
• Edit job definition
• Update jobs in Bulk
• Pausing, Resuming, Restarting failed jobs
• Delete jobs
27. Today we learned how to
Search Repository Object
Run Report
Schedule Report Execution
Editor's Notes A listener watches for an event to be fired.
A listener watches for an event to be fired.
A listener watches for an event to be fired.
A listener watches for an event to be fired.
A listener watches for an event to be fired.
A listener watches for an event to be fired.
Maybe don’t show this slide.
Alright so now that we’ve got that introduction, let’s talk about visualize.js. First thing’s first, what is it?
Answer the question why this is important for our customers?
Also we have a log out service. We can cover this in questions section. Do I need to explain repository? Why do we need this Profile Attributes and What’s MT ?
Thus each user running the same reprot can see different data. That leads us to our next question: why should my company care about visualize.js? Демо (не Дімо) Демо (не Дімо) Демо (не Дімо)