title: Create grafana dashboards with api
body: <p>I'm trying to create grafana dashboards from a template with the api from grafana. I use grafana v2.0.2 at the moment.</p>
  
  <p>I have an api key and I'm able to get the dashboards with curl, but I'm unable to create dashboards. </p>
  
  <p>When I do the following request: <code>curl -i -H "Authorization: Bearer eyJrIobfuscatedlkIjoxfQ==" http://localhost:3000/api/dashboards/db/webserver2</code>
  then I get the json back for the dasboard.</p>
  
  <p>When I try to create the simplest dashboard I found in the api examples it does not work: <code>curl -i -H "Authorization: Bearer eyJrIobfuscatedlkIjoxfQ==" -d /tmp/simpledash http://localhost:3000/api/dashboards/db</code> where <code>/tmp/simpledash</code>  contains:</p>
  
  <pre><code>{
    "dashboard": {
      "id": null,
      "title": "Production Overview",
      "tags": [ "templated" ],
      "timezone": "browser",
      "rows": [
        {
        }
      ]
      "schemaVersion": 6,
      "version": 0
    },
    "overwrite": false
   }
  </code></pre>
  
  <p>I get the following response:</p>
  
  <pre><code>HTTP/1.1 422 status code 422
  Content-Type: application/json; charset=utf-8
  Date: Wed, 01 Jul 2015 16:16:48 GMT
  Content-Length: 84
  
  [{"fieldNames":   ["Dashboard"],"classification":"RequiredError","message":"Required"}]
  </code></pre>
  
  <p>I tried some variations of the json, but I always get that response and on the internet I could not find a working example. Anyone have a working example for me? I like to have this working so I can create dashboard from ansible.</p>
  
  <p>Thanks!</p>