Author Topic: Authentication required when using new api (resolved)  (Read 820 times)

0 Members and 1 Guest are viewing this topic.

Offline BarryGordon

  • Member
  • *
  • Posts: 4
Authentication required when using new api (resolved)
« on: April 06, 2019, 11:39:36 PM »
I used to use the free api, but since that is no longer available I have bought a PWS, set it up and started converting my program that requests and displays the weather information on my wall mounted iPads.

The URL I send (with station id and api key obfuscated) is:
 https://api.weather.com/v3/pws/obsrvations/current?stationId=KFLMxxxxxxx&format=json&units=e&apikey=xxxxxxx45a94yyyyyyyyyye45a9d5da1c

My system returns a message that states "Authentication needed". I could not find any description as to how authentication is to be provided and what it consists of. The sample requests in the api documentation do not have any authentication in them.  Do I need to supply any other https headers that are not shown in the sample request stings?


« Last Edit: April 11, 2019, 09:35:40 PM by saratogaWX »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5520
    • KomokaWeather
Re: Authentication required when using new api
« Reply #1 on: April 07, 2019, 12:01:06 AM »
But there is still a free WU api for those that are sending data to WU.  I am using it.
Possibly the paid version gives you more...


Enjoy,
Paul

Offline WSWeather

  • Forecaster
  • *****
  • Posts: 483
Re: Authentication required when using new api
« Reply #2 on: April 07, 2019, 12:12:40 AM »
Possibly the paid version gives you more...
At $200/mo (minimum) it better cook dinner and wash your car.  \:D/

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Authentication required when using new api
« Reply #3 on: April 07, 2019, 11:02:12 AM »
I used to use the free api, but since that is no longer available I have bought a PWS, set it up and started converting my program that requests and displays the weather information on my wall mounted iPads.

The URL I send (with station id and api key obfuscated) is:
 https://api.weather.com/v3/pws/obsrvations/current?stationId=KFLMxxxxxxx&format=json&units=e&apikey=xxxxxxx45a94yyyyyyyyyye45a9d5da1c

My system returns a message that states "Authentication needed". I could not find any description as to how authentication is to be provided and what it consists of. The sample requests in the api documentation do not have any authentication in them.  Do I need to supply any other https headers that are not shown in the sample request stings?


If you have a NEW WU API key, then a request like

https://api.weather.com/v2/pws/observations/current?stationId=KMAHANOV10&format=json&units=e&apiKey=yourApiKey

will work.  I think you're trying to use the /v3/ instead of the /v2/ version of the query to the API.  We (PWS users) have to use what they've documented here for the API calls allowed with the new keys.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline BarryGordon

  • Member
  • *
  • Posts: 4
Re: Authentication required when using new api
« Reply #4 on: April 07, 2019, 04:32:40 PM »
Thanks, the correct version solved the problem.

 

anything