I am using the JSON API plugin for Grafana | Grafana Labs and am trying to setup a OpenWeatherMap URL that uses an appid token. https://api.openweathermap.org/data/2.5/onecall?lat=49.17&lon=11.72&appid=[token].
How do I enter it? I have tried (shown below):
URL: https://api.openweathermap.org/data/2.5/onecall?lat=49.17&lon=11.72
With Credentials: yes
Custom HTTP Headers:
Header: Authorization and Value: Bearer [token]
I got the error: JSON API: Bad Request
In Grafana Log I found this message: level=info msg=“Authentication to data source failed” body=“{"cod":401, "message": "Invalid API key. Please see Frequently Asked Questions - OpenWeatherMap for more info."}” statusCode=401
I tested my URL and token with: curl -s “https://api.openweathermap.org/data/2.5/onecall?lat=49.17&lon=11.72&appid=[token]” and I got data. The URL works fine.
I tested the URL with following: curl -v “https://api.openweathermap.org/data/2.5/onecall?lat=49.17&lon=11.72” --header “Authorization: Bearer [token]” But now, I got error message like Invalid API key.
Maybe OpenWeatherMap doesn’t support the second form of API call?