Refreshing Token Daily

I created a Grafana dashboard that pulls ITSM data from BMC Remedy (change requests, incidents, tasks). It does this by making a GET request. The token used to make these calls is stored as a variable, which I then reference in the HTTP Headers. However, this token expires daily. Each day, I need to create a new token using Postman and copy-paste this value into the Grafana variables. This process is repetitive and cumbersome. Therefore, I am seeking an automated way to refresh this token. We are running Grafana Cloud, so I cannot store this on the server within the environment variables (against org policy). I will need to refresh the token via API. Any suggestions?

Is this token used for infinity datasource?

Yes, it is.

It does yet implement token refresh so I would do the creation of the token, the datasource and the dashboard via script maybe?

Yes, agreed. I have a script that generates a token. But, how do I update the variable within Grafana Cloud locally, from my computer? Is there an Grafana API that I can interact with?

1 Like

from where can I find the right URL for the API call?

GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk