i met 401 when i use api requests a few days ago,it looked like it was rejected .Even though i used error acount password,it did not return reponse like invalid username or password.
Probably to prevent someone from guessing and figuring out the user name or password
Can you show us what you are using? Is it python script?
I used this to test and i view logs on the server console.
curl -H "Authorization: Bearer mytoken" https://myIP/api/org
logger=context userId=0 uname= t=2024... level=info msg= error="[auth.unauthorized]" cannot authenticate request traceID=
What version of grafana. And which documentation did you use for this approach
The version of grafana is 11.1.3.I reffer to documentation with the link âHTTP API | Grafana documentationâ
I confirmed the configuration of api
[api]
enabled = true
That is for old version see this
Also missing a few items
-H âContent-Type: application/jsonâ
Etc
I added -H âContent-Typeâ ,but it did not work.it looked like the request wonât be
Authorized with the url contained â/apiâ
Post exactly what you did minus ip and token
even though i used error token or use error account, it always return like the picture says
What is this error token error account?
What do you want it to return other than 401
As we can knowďźif i use error account ďźitwould return like âInvalid username or passwordâ.I notice that just want to help to figure out the problem,it is not important.