Page 1 of 1

API changes in 3190?

Posted: Fri 24 Jun 2022 12:48 am
by jbatchelor51
I have not has any issues moving forward in builds until this last one from 3184 to 3190.

I am using API JSON calls to pull data into WebCore (for home automation) and a tiny display built on an ESP NodeMCU.

Something changed in how the JSON is being delivered? I went back to 3184 and all my code started working again.

It must be subtle since I dropped the URL into local browser and I see data.
any advice is welcomed!

thx
jim

Re: API changes in 3190?

Posted: Fri 24 Jun 2022 10:12 am
by philpugh
hi,

There have been some changes to the webtags. Why not set the list web tags (Program Settings/General Options) from the console display (e.g. http::/yourcmx address:8998)

This generates a text file with all the current webtags - check which ones are missing/changed!

Re: API changes in 3190?

Posted: Fri 24 Jun 2022 11:31 am
by mcrossley
jbatchelor51 wrote: Fri 24 Jun 2022 12:48 am I have not has any issues moving forward in builds until this last one from 3184 to 3190.

I am using API JSON calls to pull data into WebCore (for home automation) and a tiny display built on an ESP NodeMCU.

Something changed in how the JSON is being delivered? I went back to 3184 and all my code started working again.

It must be subtle since I dropped the URL into local browser and I see data.
any advice is welcomed!

thx
jim
No intentional changes, but some of the libraries have changed. Which API calls are you using? And what platform are you running on?

Re: API changes in 3190?

Posted: Sat 25 Jun 2022 12:43 pm
by jbatchelor51
nothing fancy
going to my ESP panel..
/api/tags/process.json?rc&temp&hum&dew&UV&press&rrate

been running on windows since Jan this year. Arduino library has JSON parse to extract the data from the pairs

The odd thing is when I go there in a browser window, I see the JSON pairs.

Webcore I am:

@HOME_IP+":"+@Cumulus_Port+"/"+"api/tags/process.json?rc&temp&hum&wchill&heatindex&SolarRad&press&UV"

It uses GET request and return response based on tag names.

ie response.temp

Has been working great until this last update. Started returning nulls to these 2 services as soon as I started up 3190.

So I rolled back and all worked again. got to be something subtle. as noted it works in a browser.

I'll keep digging as I get time.

thanks!
jim

Re: API changes in 3190?

Posted: Sat 25 Jun 2022 3:57 pm
by mcrossley
It may be the mime type that is returned?

Re: API changes in 3190?

Posted: Sat 25 Jun 2022 5:00 pm
by mcrossley
Forget that, I just checked and it still returns application/json, the JSON syntax is valid, so... :?

The dashboard interface also uses API calls and they seem to still be working OK.

Re: API changes in 3190?

Posted: Sat 20 Aug 2022 1:30 am
by jbatchelor51
I finally had time to sit and look at the JSON. On my ESP using Arduino IDE (using ArduinoJson.h) I debugged (with help of online JSON library) and found a character in front of the first brace. a ⸮ causing deserialization to fail. in my working rev 3184 the character is a {

so a 'space' character? not seen in HTML?

maybe expected with updated libraries?


james

Re: API changes in 3190?

Posted: Sun 21 Aug 2022 9:31 am
by mcrossley
It is adding a Unicode BOM to all output. It appears that is the default for MS when sending UTF-8 responses, even though they themselves say an BOM is not required for UTF-8! :bash:

v3.20.0 now explicitly disables the BOM on API responses.

Re: API changes in 3190?

Posted: Sun 21 Aug 2022 3:26 pm
by jbatchelor51
3202
looking good! thx!