I am trying to import the Grafana dashboard using HTTP API by following Grafana
Grafana Version: 5.1.3 OS -Windows 10
This is what i tried
curl --user admin:admin “http://localhost:3000/api/dashboards/db” -X POST -H “Content-Type:application/json;charset=UTF-8” --data-binary @c:/Users/Mahadev/Desktop/Dashboard.json
and Here is my python code
import requests
headers = {
‘Content-Type’: ‘application/json;charset=UTF-8’,
}data = open(‘C:/Users/Mahadev/Desktop/Dashboard.json’, ‘rb’).read()
response = requests.post(‘http://admin:admin@localhost:3000/api/dashboards/db’, headers=headers, data=data)
print (response.text)
And output of both is:
[{“fieldNames”:[“Dashboard”],“classification”:“RequiredError”,“message”:“Required”}]
It is asking for root property called dashboard in my json payload. Can anybody suggest me how to use that porperty and what data should i provide.