# Automatically download dashboard csv file by api fail

**URL:** <https://discuss.elastic.co/t/automatically-download-dashboard-csv-file-by-api-fail/284441>\
**Category:** Kibana\
**Tags:** elastic-stack-reporting\
**Created:** [September 17, 2021, 3:03am UTC](https://discuss.elastic.co/t/automatically-download-dashboard-csv-file-by-api-fail/284441 "2021-09-17T03:03:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luckygoodlily](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luckygoodlily/32/94699_2.png) [@luckygoodlily](https://discuss.elastic.co/u/luckygoodlily)\
**Post date:** [September 17, 2021, 3:03am UTC](https://discuss.elastic.co/t/automatically-download-dashboard-csv-file-by-api-fail/284441/1 "2021-09-17T03:03:45Z")

</div>

Hello, we are developing a project for company, and we are working with the ELK stack.

I have a problem that I have some visualizations in Dashboard and I want to download csv file by shell script ([Automatically generate reports | Kibana Guide [7.14] | Elastic](https://www.elastic.co/guide/en/kibana/current/automating-report-generation.html#use-a-script)), but I am not sure how to put value in`jobParams` or where do I learn to get the value of `jobParams` .

I try to google find some example,but that will return "404 Not Found" or "400 Bad Request".

Here are the command that I tried to download:

```auto
> curl -X POST \
> -u 'elastic:password' \
> -H 'kbn-xsrf: true' \
> 'https://myKibanaHostname/api/reporting/generate/csv?jobParams=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))'
{"statusCode":404,"error":"Not Found","message":"Not Found"}

```

```auto
 curl -X POST \
> -u 'elastic:password' \
> -H 'kbn-xsrf: true' \
> 'https://myKibanaHostname/api/reporting/generate/csv?jobParams=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-1h,to:now))&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),tags:!(),timeRestore:!f,title:'Top%20N%20%20Copy',viewMode:edit)'
{"statusCode":400,"error":"Bad Request","message":"[request query]: types that failed validation:\n- [request query.0._a]: definition for this key is missing\n- [request query.1]: expected value to equal [null]"}

```

We are very urgent to be able to solve this problem because it is of strategic significance.

Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)\
**Post date:** [October 1, 2021, 1:05pm UTC](https://discuss.elastic.co/t/automatically-download-dashboard-csv-file-by-api-fail/284441/2 "2021-10-01T13:05:24Z")

</div>

Hi @luckygoodlily,

you can get `jobParams` by going to `Discover > share > csv reports > advanced options > copy post url` and you'll get and URL with correct jobParams for your automated report.

Same for Dashboard, but for png/pdf reports

---

<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:** [October 29, 2021, 1:05pm UTC](https://discuss.elastic.co/t/automatically-download-dashboard-csv-file-by-api-fail/284441/3 "2021-10-29T13:05:54Z")

</div>

Closed on October 29, 2021, 1:05pm UTC

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