Generate PDF Report from an external app

Hi,

I would like to execute/call the Generation URL (PDF) from my web app (outside Kibana), is that possible?

Please note that security features (i.e. using x-pack) are enabled in Kibana.

Regards,
Kenneth

You can POST to the reporting URL with your credentials:

curl -H 'kbn-xsrf: true' -X POST "https://elastic:changeme@localhost:9200/api/reporting/generate/csv?jobParams=[redacted]"

@tylersmalley thanks for the response. However, I noticed you are providing a CSV endpoint? should it be pdf?

On a high-level we are planning to do this:

  1. Enable security on ElasticSearch and Kibana.
    1.1. Accessing an endpoint on Elastic or Kibana when security is enabled.
  2. Embed the Kibana dashboard in an external web app.
    2.1 Allow user to generate PDF from an external web app.
    2.2 Allow user to download the generated PDF from the external web app (without accessing Kibana app).

Greatly appreciate if you could point me to the right section of the documentation or links to sample codes (for guidance) to achieve this.

Cheers,
Kenneth

1 Like

@tylersmalley i am still unable to generate the report when making a POST to the reporting URL using jquery $.ajax(). the request gets preflighted (chrome sends an OPTIONS request first) due to the custom header 'kbn-xsrf: true'. when chrome makes a preflight request to the reporting URL it gets a HTTP 404 error. so i am not able to proceed.

may i know if there's a way to overcome this?

Note: using Postman tool the request succeeds.

thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.