0

I'm using Grafana free version (v8.5.0). I'm using python 3.7 and sending requests to Grafana. But it is not working. Below is my Code.

import requests

import json

base_url="https://MY_USERNAME:MY_PASSWORD@santoshburadalearning.grafana.net"

resp = requests.get(base_url+"/app/dashboards/home", verify=True)

data = resp.json()

print(data)

Output:

{'message':'invalid username or password', 'traceId':'1710926f6a9a7120'}

Thanks In Advance...

1 Answers1

0
import requests

base_url="https://santoshburadalearning.grafana.net"

s = requests.Session()
s.auth = ('MY_USERNAME', 'MY_PASSWORD')
resp = s.get(base_url+ "/api/search/", verify=False)
data = resp.json()

print(data)
  • Answer needs supporting information Your answer could be improved with additional supporting information. Please [edit](https://stackoverflow.com/posts/76234417/edit) to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](https://stackoverflow.com/help/how-to-answer). – moken May 14 '23 at 09:22