# Is it possible to automatically send those reports files after generating?

**URL:** <https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352>\
**Category:** Reporting Plugin\
**Created:** [March 16, 2021, 3:36pm UTC](https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352 "2021-03-16T15:36:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThibaudF](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/thibaudf/32/31_2.png) [@ThibaudF](https://forum.opensearch.org/u/ThibaudF)\
**Post date:** [March 16, 2021, 3:36pm UTC](https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352/1 "2021-03-16T15:36:33Z")

</div>

Hello guys !  
I’ve just upgraded ODFE version from 1.3 to 1.13 (ELS 7.3.2 → 7.10.2).

I’m trying out the reporting plugin, the only interesting part I found for the upgrade.

Is it possible to send those PDF automatically by email ?  
I can’t see any options to do this. It’s available in the alerting parts though.

Right now, I’m developing my own email sender, grabbing PDF from Kibana Reporting plugin API.

EDIT#2: I fixed the problem, it required a special Cookie. So first I call /api/reporting/reports to generate it.

SOLVED: Trying to get by API the PDF generated by the scheduler, calling GET `/api/reporting/generateReport/${report_id}` It works by Postman but by Python script It doesn’t work ☹

```auto
{"statusCode":500,
"error":"Internal Server Error",
"message":"waiting for selector \\"#dashboardViewport\\" failed: timeout 60000ms exceeded"}

```

Found some log in kibana :

```auto
TimeoutError: waiting for selector \"#dashboardViewport\" failed: timeout 60000ms exceeded\n at new WaitTask (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:549:28)\n at DOMWorld._waitForSelectorOrXPath (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:478:22)\n at DOMWorld.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/DOMWorld.js:432:17)\n at Frame.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/FrameManager.js:627:47)\n at Frame.<anonymous> (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/helper.js:112:23)\n at Page.waitForSelector (/usr/share/kibana/plugins/opendistroReportsKibana/node_modules/puppeteer-core/lib/Page.js:1095:29)\n at createVisualReport (/usr/share/kibana/plugins/opendistroReportsKibana/server/routes/utils/visual_report/visualReportHelper.ts:129:18) name: 'TimeoutError'

```

Thank you !  
Thi

---

<div class="post-metadata">

**Author:** ![VK1](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@VK1](https://forum.opensearch.org/u/VK1)\
**Post date:** [April 1, 2021, 8:42pm UTC](https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352/2 "2021-04-01T20:42:26Z")

</div>

Is it working for you?  
I tried using **GET /api/reporting/generateReport/** in the dev-tools from kibana but got an error  
{  
“error” : “no handler found for uri [/api/reporting/generateReport/?pretty=true] and method [GET]”  
}

---

<div class="post-metadata">

**Author:** ![ThibaudF](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/thibaudf/32/31_2.png) [@ThibaudF](https://forum.opensearch.org/u/ThibaudF)\
**Post date:** [April 2, 2021, 8:13am UTC](https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352/3 "2021-04-02T08:13:49Z")

</div>

Hi !  
Can you give more details?

The **GET /api/reporting/generateReport/** call needs a report ID. So it should be a report already generated. I think this is what the error is telling you.

Thi

---

<div class="post-metadata">

**Author:** ![juliennix](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@juliennix](https://forum.opensearch.org/u/juliennix)\
**Post date:** [June 11, 2021, 12:59pm UTC](https://forum.opensearch.org/t/is-it-possible-to-automatically-send-those-reports-files-after-generating/5352/4 "2021-06-11T12:59:15Z")

</div>

Hello,

We are trying to automatize the creation of report to send them afterwards via mail.  
We have kibana working with SAML and internal users.  
When trying to get the report via postman/insomnia (browser obviously), it is working with the following:  
[https://kibana-url/api/reporting/generateReport/:reportId?timezone=Europe%2FBerlin](https://kibana-url/api/reporting/generateReport/:reportId?timezone=Europe%2FBerlin)

- Basic authentication + cookie: security\_authentication.

When trying without the cookie, we receive the following:  
{  
“statusCode”: 500,  
“error”: “Internal Server Error”,  
“message”: “waiting for selector "#dashboardViewport" failed: timeout 60000ms exceeded”  
}  
Which does not make a lot of sens right now. Is it possible to trigger the report creation without the cookie ? Why is elasticsearch creating the report searching for the html element with id dashboardViewport is also confusing…

If anyone can help, it would be wonderful 🙂 !
