While calling Create dasboard API through postman returns success but does not create panel in dashboard

Here is my json request & response Please suggest
JSON request
{
“annotations”: {
“list”: [
{
“builtIn”: 1,
“datasource”: “-- Grafana --”,
“enable”: true,
“hide”: true,
“iconColor”: “rgba(0, 211, 255, 1)”,
“name”: “teststst”,
“type”: “dashboard”
}
]
},
“editable”: true,
“gnetId”: null,
“graphTooltip”: 0,
“id”: null,
“links”: [],
“panels”: [
{
“cacheTimeout”: null,
“datasource”: “Influxgrafana”,
“description”: “DISK SPACE OF SERVER”,
“gridPos”: {
“h”: 3,
“w”: 4,
“x”: 0,
“y”: 0
},
“id”: null,
“links”: [],
“options”: {
“maxValue”: 100,
“minValue”: 0,
“orientation”: “auto”,
“showThresholdLabels”: false,
“showThresholdMarkers”: true,
“thresholds”: [
{
“color”: “super-light-green”,
“index”: 0,
“value”: null
},
{
“color”: “light-green”,
“index”: 1,
“value”: 10
},
{
“color”: “super-light-blue”,
“index”: 2,
“value”: 20
},
{
“color”: “light-blue”,
“index”: 3,
“value”: 30
},
{
“color”: “super-light-yellow”,
“index”: 4,
“value”: 40
},
{
“color”: “semi-dark-yellow”,
“index”: 5,
“value”: 50
},
{
“color”: “#6ED0E0”,
“index”: 6,
“value”: 60
},
{
“color”: “super-light-orange”,
“index”: 7,
“value”: 70
},
{
“color”: “super-light-red”,
“index”: 8,
“value”: 80
}
],
“valueMappings”: [],
“valueOptions”: {
“decimals”: null,
“prefix”: “”,
“stat”: “last”,
“suffix”: “”,
“unit”: “decgbytes”
}
},
“pluginVersion”: “6.1.6”,
“targets”: [
{
“groupBy”: [],
“measurement”: “serverspacedtls”,
“orderByTime”: “ASC”,
“policy”: “default”,
“refId”: “A”,
“resultFormat”: “time_series”,
“select”: [
[
{
“params”: [
“diskspaceused”
],
“type”: “field”
}
]
],
“tags”: []
}
],
“timeFrom”: null,
“timeShift”: null,
“title”: “DISK SPACE”,
“transparent”: true,
“type”: “gauge”
}
],
“schemaVersion”: 18,
“style”: “dark”,
“tags”: [],
“templating”: {
“list”: []
},
“time”: {
“from”: “2019-05-23T06:10:24.153Z”,
“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”
]
},
“dashboard”: {
“id”: null,
“uid”: null,
“title”: “Production30050102”,
“timezone”: “browser”,
“schemaVersion”: 16,
“version”: 0
}
}

JSON response

{
“id”: 44,
“slug”: “production30050102”,
“status”: “success”,
“uid”: “TTjsbVGWk”,
“url”: “/d/TTjsbVGWk/production30050102”,
“version”: 1
}

JSON model for created dashbaord has empty panel array but I have passed value for it in my json request

please help me on this

Hi,

Your POST request is almost correct but I see the error.
This is a slightly modified example from the documentation:

{
  "dashboard": {YOUR_DASHBOARD_MODEL_HERE},
  "folderId": 0,
  "overwrite": true
}

Documentation: https://grafana.com/docs/http_api/dashboard/#create-update-dashboard

You have to move everything under "dashboard": {}.

1 Like

Hello Team,

Thanks for assistance, it worked for me.

Regards

VIjay G

Hello Team,

Please suggest me on below issue. Thanks in advance !!

https://community.grafana.com/t/non-editable-dashboard-in-web-app-with-real-time-data-should-be-displayed/17987?u=vijayg3870

Regards

Vijay Gharal

Notice to Recipient: This electronic message contains information from Aurionpro Solutions (“Aurionpro”), which may be confidential. The information in this message is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify Aurionpro by email immediately and thereafter delete this message from your system. Aurionpro and its affiliates do not accept liability for any personal views expressed in this message or for any viruses inadvertently transmitted through this email.