Setting up snapshot api for beginners

Nice! Now read this part of the docu carefully specifically as it relates to external

JSON Body schema:

yes I applied the “external”:True such that it puts it on the cloud but that doesn’t work. How could I solve that?

1 Like

Read the doc again. When using external there are other required parameters

1 Like

I have added a key and delete key but still get the same result. I can define those keys myself right?

it looks like this;

snapshot_data = {
“key”: “admin1”,
“deleteKey”: “admindel”,
“external”: True,
“dashboard”: {…},
“expires”: 3600,
“name”: “snapshot api testing”
}

In the docu if you notice it says in the Note section

…including the snapshot data.

A snapshot cannot reach back to your grafana and get the data from the data source(s) in your dashboard…which makes sense.

Please read this thread

https://localhost:3000/t/snapshot-using-http-api-does-nothing/8834/15

I have made some progress and understood what I have to do to make it work, however I do not understand where I can extract the right json file of the dashboard for generating a snapshot, like the code provided at the request part of point three in this post: Snapshot using http api does nothing - #10 by mefraimsson

I found a way to write code for extracting the correct data from the dashboard for which I want to generate a dashboard, I now need to have the right json code to supply that data too. Can this json template be found on the grafana database, or does it need to be manually coded?

Any advice would be appreciated, thank you.

Have you tried grafana image renderer plugin?
You just have to post request on your grafana instance (http://grafana:3000/render/d?&someparameters)

This will automatically generate png file on your side.

1 Like