Hi, I’m trying to connect to grafana from a python script.
import requests
headers = {
"Authorization": "Bearer XXXXXXXXXXXXXXXXXXXX"
}
url = "http://grafana.staged-by-discourse.com/api/dashboards/home"
r = requests.get(url, headers, verify=False)
print(r)
print(r.json())
And i always get message:
<Response [401]>
{‘message’: ‘Unauthorized’}
But if instead of runing the request in python i do curl, with the same token. I get the expected result.
I’ve been looking to other posts related to the API and the unauthorized message but I didn’t foun any solution