# Generate PDF Report from an external app

**URL:** https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010
**Category:** Kibana
**Created:** [March 29, 2018, 2:54am UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010 "2018-03-29T02:54:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kenneth](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kenneth](https://discuss.elastic.co/u/kenneth)
#### Post date: [March 29, 2018, 2:54am UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010/1 "2018-03-29T02:54:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [March 29, 2018, 9:00pm UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010/2 "2018-03-29T21:00:24Z")

</div>

You can POST to the reporting URL with your credentials:

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

```

---

<div class="post-metadata">

### Author: ![kenneth](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kenneth](https://discuss.elastic.co/u/kenneth)
#### Post date: [April 2, 2018, 8:57pm UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010/3 "2018-04-02T20:57:18Z")

</div>

@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

---

<div class="post-metadata">

### Author: ![kenneth](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@kenneth](https://discuss.elastic.co/u/kenneth)
#### Post date: [April 4, 2018, 4:04am UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010/4 "2018-04-04T04:04:27Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 2, 2018, 4:04am UTC](https://discuss.elastic.co/t/generate-pdf-report-from-an-external-app/126010/5 "2018-05-02T04:04:42Z")

</div>

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