Curl'ing Kibana Dashboards exported into NDJSON

Ok @plissken

Here is what I have for you now... and Wow that seemed a bit harder than I thought ...

So this is for an individual I used _export and _import ... I have not tried _bulk yet

So first I list to find the Object I am after in my initial / default space

# Get Dashboards
curl -X GET -H 'Content-Type: application/json' -H 'kbn-xsrf: true' http://localhost:5601/api/saved_objects/_find?type=dashboard | jq

In this case is is the eCommerce Dashboard

    {
      "type": "dashboard",
      "id": "722b74f0-b882-11e8-a6d9-e546fe2bba5f",

So now I _export it ... it takes both the type and id as far as I can tell in the objects array

# Export the actual Dashboard
curl -X POST -H 'Content-Type: application/json' -H 'kbn-xsrf: true' http://localhost:5601/api/saved_objects/_export -d '{"objects":[{"type":"dashboard","id":"722b74f0-b882-11e8-a6d9-e546fe2bba5f"}]}' > saved-dashboard.ndjson

Now _import to another space look at the syntax careful

# Import to a new space
curl -X POST -H 'kbn-xsrf: true' http://localhost:5601/s/test/api/saved_objects/_import?createNewCopies=true --form file=@saved-dashboard.ndjson
{"successCount":1,"success":true,"warnings":[],"successResults":[{"type":"dashboard","id":"722b74f0-b882-11e8-a6d9-e546fe2bba5f","meta":{"title":"[eCommerce] Revenue Dashboard","icon":"dashboardApp"},"destinationId":"e410188d-e9fd-40cc-bdc9-aa307d0a7165"}]}

And my Pretty new dashboard in my space test

I can probably look at the _bulk at some point if you still need that