Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Not receiving any response text

Brittni Dec 30, 2018 10:00PM GMT

So I chose to use the weathermap API for a class project and I'm trying to test it just to see if it works. My key is a few days old so it should be usable. My problem is that when I try to print out any information on a specific city, I receive the following:

error
Promise {
readyState: 4,
getResponseHeader: [Function],
getAllResponseHeaders: [Function],
setRequestHeader: [Function],
overrideMimeType: [Function],
statusCode: [Function],
abort: [Function],
state: [Function],
always: [Function],
catch: [Function],
pipe: [Function],
then: [Function],
promise: [Function],
progress: [Function],
done: [Function],
fail: [Function],
responseText: 'Not found',
status: 404,
statusText: 'error' }

I don't know why I'm not receiving any response text back. Can anyone help me out here?

This is what my code looks like:
$.ajax({
url : "api.openweathermap.org/data/2.5/weather?",
method : "GET",
dataType : 'JSON',
data:
{
'id':'2643743',
'APPID': '(censored so no one can use my key without me knowing)'

}
,
async: false,
headers: {
Accept: 'application/json',
}
})
.done(result=>{
console.log("success");
console.log(result);
})
.fail(err => {
console.log("error");
console.log(err);
});

Up 0 rated Down
Pavel Zuykov Jan 04, 2019 02:28AM GMT OpenWeatherMap Agent

Hello,

You can test your key just if paste in the end of this example, and try to open it in web browser: https://api.openweathermap.org/data/2.5/weather?q=brooklyn&APPID=

From quick look seems like you have wrong syntax in url, and variables does not pasted right way.

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete