Support Center

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

401 error from api call. angular 2

priyanka Apr 05, 2019 11:03AM BST

if i use this api
https://samples.openweathermap.org/data/2.5/forecast?id=524901&appid=b6907d289e10d714a6e88b30761fae22
i am getting error [Access to XMLHttpRequest at 'https://samples.openweathermap.org/data/2.5/forecast?id=524901&appid=b6907d289e10d714a6e88b30761fae22' from origin 'http://localhost:3002' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.]


if i use below api
https://api.openweathermap.org/data/2.5/forecast?id=524901&appid=b6907d289e10d714a6e88b30761fae22

error [http.dev.js:683 GET https://api.openweathermap.org/data/2.5/forecast?id=524901&appid=b6907d289e10d714a6e88b30761fae22 401 (Unauthorized)]

pls help me

Up 0 rated Down
Pavel Zuykov Apr 05, 2019 12:10PM BST OpenWeatherMap Agent

Hello.

You are using sample APPID. Please use your own API key.

Up 0 rated Down
A G Priyanks Apr 06, 2019 03:18PM BST
Hello,
Thank you for the response it helped to prove myself correct, this apis are given by some company for the interview but the didn't mention API Key.

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