flienart Posted January 13, 2022 Share Posted January 13, 2022 Hi,I have some trouble to get the resulting report when i launch a call to REST.With postman, il send a GET to this endpoint for logging :http://srv-test:8080/jasperserver/rest_v2/login?j_username=user&j_password=pwd.In Postman, i get a cookie with a JSESSIONID.Next, i launch this POST query to execute a report (same cookie) :http://srv-test:8080/jasperserver/rest_v2/reportExecutionsThis is the body :<reportExecutionRequest> <reportUnitUri>/reports/interactive/TableReport</reportUnitUri> <async>false</async> <freshData>true</freshData> <saveDataSnapshot>false</saveDataSnapshot> <outputFormat>pdf</outputFormat> <interactive>true</interactive></reportExecutionRequest>I check the headers request to verify if this is the same cookie. It's the same.This is the response :{ "status": "ready", "totalPages": 4, "requestId": "6f8ab161-597d-43e8-bc4c-b0f74316b69c", "reportURI": "/reports/interactive/TableReport", "exports": [ { "status": "ready", "outputResource": { "contentType": "application/pdf", "fileName": "TableReport.pdf", "outputFinal": true, "outputTimestamp": 0 }, "id": "36e04925-194f-4032-af92-c3589d9042be" } ]}When i launch the final query (GET) to retrieve the report i get an error. (same cookie in header)http://srv-test:8080/jasperserver/rest_v2/reportExecutions/6f8ab161-597d-43e8-bc4c-b0f74316b69c/exports/36e04925-194f-4032-af92-c3589d9042be/outputResource Error : <?xml version="1.0" encoding="UTF-8" standalone="yes"?><errorDescriptor> <errorCode>resource.not.found</errorCode> <message>Ressource 36e04925-194f-4032-af92-c3589d9042be introuvable.</message> <parameters> <parameter>36e04925-194f-4032-af92-c3589d9042be</parameter> </parameters></errorDescriptor>I don't understant why i get this error because it's the same cookie for each query...Thanks in advance for reply.Sorry for my poor english. Link to comment Share on other sites More sharing options...
yama818 Posted January 15, 2022 Share Posted January 15, 2022 Is your requirement to get the report in PDF?If yes, I think you can achieve this by simply issuing the following URL in the GET method.* Referencehttps://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v790/reports-service* Example URLhttp://srv-test:8080/jasperserver/rest_v2/reports/public/test_report.pdf?j_username=user&j_password=pwd Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now