How to use curl to export dashboard objects?

Describe the issue:
I wanted to try and make a script that would download the exported dashboards from
https:// localhost:5202/_dashboards/app/management/opensearch-dashboards/objects and export all of the dashboards into a ndjson file, but I can’t seem to get this to work.

For example I’ve tried: url -v -X POST “http:// localhost:5202/api/saved_objects/_export?overwrite=true” -H “osd-xsrf: true” --insecure

or something like:

curl -XGET “https:// localhost:9202/_dashboards/app/management/opensearch-dashboards/objects/_export” -insecure

I usually just get 404 errors or the webpage HTML itself. Sorry if this is a dumb question I don’t often work with cURL. Any help is appreciated. [btw I put spaces in the https:// localhost because it wouldn’t let me post otherwise.]

Hi @curlquest,

I came across this discussion on how to import dashboards, if that’s any helpful:

best,
mj

@curlquest I’ve answered this question in your other thread.

1 Like