Created Dashboard in new Folder

Created new folder then created new dashboard to be in new folder. New dashboard ended up in General and not new folder:

-------------------------------------------------------------------
http://murray-groundwork/grafana/api/folders
POST:
body:
{
  "uid": "GWFOLD0001",
  "title": "Groundwork Grafana Templates"
}
------------------------------------------------------------------------------------------
Response:
{
    "id": 22,
    "uid": "GWFOLD0001",
    "title": "Groundwork Grafana Templates",
    "url": "/grafana/dashboards/f/GWFOLD0001/groundwork-grafana-templates",
    "hasAcl": false,
    "canSave": true,
    "canEdit": true,
    "canAdmin": true,
    "createdBy": "admin",
    "created": "2018-03-19T09:50:36-07:00",
    "updatedBy": "admin",
    "updated": "2018-03-19T09:50:36-07:00",
    "version": 1
}
==========================================================================================

my create dashboard api call:
http://murray-groundwork/grafana/api/dashboards/db
POST
Content-Type: application/json
Accept: application/json
Basic auth: admin/admin
body of post:
…
“type”: “db”,
“canSave”: true,
“canEdit”: true,
“canAdmin”: true,
“canStar”: true,
“slug”: “gw-template-variables”,
“url”: “/grafana/d/GWDASH0002/gw-template-variables”,
…
“folderId”: 22,
“folderTitle”: “Groundwork Grafana Templates”,
“folderUrl”: “/grafana/dashboards/f/GWFOLD0001/groundwork-grafana-templates”
…
“uid”: “GWDASH0002”,
…
response:
{
“id”: 21,
“slug”: “gw-template-variables”,
“status”: “success”,
“uid”: “GWDASH0002”,
“url”: “/grafana/d/GWDASH0002/gw-template-variables”,
“version”: 1
}

dashboard was created in General folder.

Hi,

Please use the correct request body, see http api documentation.

Marcus

ok this worked:
{
“dashboard”: {
“description”: “This dashboard contains a set of useful dashboard template variables which can be used in other dashboards.”,
“id”: null,
“timezone”: “browser”,
“title”: “GW Template Variables”,
“uid”: “GWDASH0002”,
“schemaVersion”: 16,
“version”: 0
},
“folderId”: 22,
“overwrite”: true
}

What i’m trying to do is export dashboards created in Grafana 4.6.3 and after a Grafana 5.0.2 upgrade do a get and reformat json so i can import to another Grafana 5.0.2 system. I will keep working on this. thanks for your help.

got it to work using the following json:
{
“dashboard”: {
“annotations”: {
“list”: []
},
“description”: “This dashboard contains a set of useful dashboard template variables which can be used in other dashboards.”,
“editable”: true,
“gnetId”: null,
“graphTooltip”: 0,
“hideControls”: false,
“id”: null,
“links”: [],
“rows”: [
{
“collapse”: false,
“height”: “250px”,
“panels”: [
{
“aliasColors”: {},
“bars”: false,
“dashLength”: 10,
“dashes”: false,
“datasource”: “GroundWork”,
“description”: “Host and host service template variables example”,
“fill”: 1,
“id”: 1,
“legend”: {
“avg”: false,
“current”: false,
“max”: false,
“min”: false,
“show”: true,
“total”: false,
“values”: false
},
“lines”: true,
“linewidth”: 1,
“links”: [],
“nullPointMode”: “null”,
“percentage”: false,
“pointradius”: 5,
“points”: false,
“renderer”: “flot”,
“seriesOverrides”: [],
“spaceLength”: 10,
“span”: 12,
“stack”: false,
“steppedLine”: false,
“targets”: [
{
“host”: “$host”,
“hostgroup”: “Linux Servers”,
“queryType”: “byHost”,
“refId”: “A”,
“service”: “$service”,
“servicegroup”: “Select service group”
}
],
“thresholds”: [],
“timeFrom”: null,
“timeShift”: null,
“title”: “Host / Service : $host/$service”,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“type”: “graph”,
“xaxis”: {
“buckets”: null,
“mode”: “time”,
“name”: null,
“show”: true,
“values”: []
},
“yaxes”: [
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
},
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
}
]
}
],
“repeat”: null,
“repeatIteration”: null,
“repeatRowId”: null,
“showTitle”: true,
“title”: “By Group/Host/Service”,
“titleSize”: “h6”
},
{
“collapse”: false,
“height”: 250,
“panels”: [
{
“aliasColors”: {},
“bars”: false,
“dashLength”: 10,
“dashes”: false,
“datasource”: “GroundWork”,
“description”: “Service group and service group service template variables example”,
“fill”: 1,
“id”: 2,
“legend”: {
“avg”: false,
“current”: false,
“max”: false,
“min”: false,
“show”: true,
“total”: false,
“values”: false
},
“lines”: true,
“linewidth”: 1,
“links”: [],
“nullPointMode”: “null”,
“percentage”: false,
“pointradius”: 5,
“points”: false,
“renderer”: “flot”,
“seriesOverrides”: [],
“spaceLength”: 10,
“span”: 12,
“stack”: false,
“steppedLine”: false,
“targets”: [
{
“host”: “Select host”,
“hostgroup”: “Select host group”,
“queryType”: “byServiceGroup”,
“refId”: “A”,
“service”: “$sg_service”,
“servicegroup”: “$sgroup”
}
],
“thresholds”: [],
“timeFrom”: null,
“timeShift”: null,
“title”: “Service Group / Service : $sgroup / $sg_service”,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“type”: “graph”,
“xaxis”: {
“buckets”: null,
“mode”: “time”,
“name”: null,
“show”: true,
“values”: []
},
“yaxes”: [
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
},
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
}
]
}
],
“repeat”: null,
“repeatIteration”: null,
“repeatRowId”: null,
“showTitle”: true,
“title”: “By Service Group/Service”,
“titleSize”: “h6”
}
],
“schemaVersion”: 14,
“style”: “dark”,
“tags”: [
“GroundWork”,
“Example”
],
“templating”: {
“list”: [
{
“allValue”: null,
“current”: {
“tags”: [],
“text”: “Linux Servers”,
“value”: “Linux Servers”
},
“datasource”: “GroundWork”,
“hide”: 0,
“includeAll”: false,
“label”: “Host Group”,
“multi”: false,
“name”: “group”,
“options”: [],
“query”: “groups”,
“refresh”: 1,
“regex”: “”,
“sort”: 1,
“tagValuesQuery”: “”,
“tags”: [],
“tagsQuery”: “”,
“type”: “query”,
“useTags”: false
},
{
“allValue”: null,
“current”: {
“text”: “localhost”,
“value”: “localhost”
},
“datasource”: “GroundWork”,
“hide”: 0,
“includeAll”: false,
“label”: “Host Name”,
“multi”: false,
“name”: “host”,
“options”: [],
“query”: “hosts( { “queryType”: “byHost”, “hostgroup”: “$group” } )”,
“refresh”: 1,
“regex”: “”,
“sort”: 1,
“tagValuesQuery”: “”,
“tags”: [],
“tagsQuery”: “”,
“type”: “query”,
“useTags”: false
},
{
“allValue”: null,
“current”: {
“tags”: [],
“text”: “local_cpu_java”,
“value”: “local_cpu_java”
},
“datasource”: “GroundWork”,
“hide”: 0,
“includeAll”: false,
“label”: “Service Name for Host”,
“multi”: false,
“name”: “service”,
“options”: [],
“query”: “services( { “host”: “$host”, “queryType”: “byHost” } )”,
“refresh”: 1,
“regex”: “”,
“sort”: 1,
“tagValuesQuery”: “”,
“tags”: [],
“tagsQuery”: “”,
“type”: “query”,
“useTags”: false
},
{
“allValue”: null,
“current”: {},
“datasource”: “GroundWork”,
“hide”: 0,
“includeAll”: false,
“label”: “Service Group”,
“multi”: false,
“name”: “sgroup”,
“options”: [],
“query”: “servicegroups”,
“refresh”: 1,
“regex”: “”,
“sort”: 0,
“tagValuesQuery”: “”,
“tags”: [],
“tagsQuery”: “”,
“type”: “query”,
“useTags”: false
},
{
“allValue”: null,
“current”: {},
“datasource”: “GroundWork”,
“hide”: 0,
“includeAll”: false,
“label”: “Service Name for Service Group”,
“multi”: false,
“name”: “sg_service”,
“options”: [],
“query”: “services( { “queryType”: “byServiceGroup”, “servicegroup”: “$sgroup” } )”,
“refresh”: 1,
“regex”: “”,
“sort”: 0,
“tagValuesQuery”: “”,
“tags”: [],
“tagsQuery”: “”,
“type”: “query”,
“useTags”: false
}
]
},
“time”: {
“from”: “now-6h”,
“to”: “now”
},
“timepicker”: {
“refresh_intervals”: [
“5s”,
“10s”,
“30s”,
“1m”,
“5m”,
“15m”,
“30m”,
“1h”,
“2h”,
“1d”
],
“time_options”: [
“5m”,
“15m”,
“1h”,
“6h”,
“12h”,
“24h”,
“2d”,
“7d”,
“30d”
]
},
“timezone”: “browser”,
“title”: “GW Template Variables”,
“uid”: “GWDASH0002”,
“version”: 1
},
“overwrite”: true,
“folderId”: 22
}