'openweathermap showing unauthorized with api key
I have this:
<script>
function gettingJSON(){
$.getJSON("http://api.openweathermap.org/data/2.5/weather?q=London&appid=",function(json){
console.log(JSON.stringify(json));
});
}
</script>
when i run this, and look at my console, i get this erorr:
[Error] Failed to load resource: the server responded with a status of 401 (Unauthorized) (weather, line 0)
my api key matches the one in the openweathermap dashboard, so wondering y its not acc working. Maybe i'm missing something. any ideaS?
Solution 1:[1]
I think you just need to put your api key in the query string.
http://api.openweathermap.org/data/2.5/weather?q=London&appid=[HERE]
Moreover it requires a couple of hours to be activated and ready to use.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tyler Durden |
