Today I have a nodered server which collects weather data (via SDR 433mhz) from my home sensors and I’m attempting to create a POST message via an HTTP REQUEST node to the PVOutput.org API containing my current temp value in degrees C every five minutes. I’m a donor to the site, and can copy and paste the POST string from NoedRed via a browser and I get the “OK Value Added” massage and I can see data in my live stream.
If I take the same exact output generated in NodeRed (SSL and I have certs working), I get an error “401: Incorrect Station ID”. If I look at the debug info, I can see the correct URL a ? and the message appears below the ? which I assumed was just because of scrolling. I have copied and pasted this to Word, Text Wrangler and other text editors to see if there are any special characters, etc., but I see nothing.
From the copy and paste (removing SID and APIKEY) you can see the end of the URL with the ? and then there is something like a return being sent. If I just send the first part of the URL query up to the ?, I get the same error in my browser. I know I’m missing something in the construction here. Any thoughts or pointers?
A piece of my flow below contain the message function to build the HTTP context and also convert my F to C temp.
The below shot shows the message body after the temp conversion and setting the context details.
POST MESSGE:
My post looks like this: “https://pvoutput.org/service/r2/addstatus.jsp?sid=SIDHERE&key=APIKEYHERE&d={{{payload.date}}}&t={{{payload.time}}}&v5={{{payload.temperature_F}}}”
Responder URL back from API (key removed):
https://pvoutput.org/service/r2/addstatus.jsp?sid=64031&key=***&d=20190109&t=15:27:15&v5=4.9
Response:
Status Code: “401”
Payload: “Unauthorized 401: Invalid System ID”