Hello
I try to get some queries from the grafana API with curl command. Loki is connected as a datasource. To test, I just need to use a simple query. So I try :
curl -k -H "Authorization: Bearer <GRAFANA_TOKEN>" -H "Content-Type: application/json" --request POST --data-urlencode '{"queries":["refId":"A","datasource":{"type":"loki","uid":"gnyGpv7Ik"},"expr":"{pod_name="argocd-application-controller-0"}","queryType":"range","maxLines":1000,"intervalMs":2000,"maxDataPoints":1815],"from":1702396843871,"to":1702400443871}' <GRAFANA_URL>/api/ds/query
The return is “bad request data”, so where are my mistakes ?
Thanks