JSON API errors

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

JSON API errors

Post by philchillbill »

I can use e.g.

Code: Select all

/json.htm?type=command&param=switchlight&idx=655&switchcmd=Toggle
via either a browser or nodejs and axios.get and it always works. However, if I try e.g.

Code: Select all

/json.htm?type=command&param=setused&idx=601&setpoint=15.0&mode=FollowSchedule&used=true
then it works via the browser as evidenced by

{
"status" : "OK",
"title" : "SetUsed"
}

but fails via nodejs and axios.get, as evidenced by

{ status: 'ERR' }

Does anybody have any idea why going via the browser would make a difference? It's a shame that the only error message is 'ERR' as it doesn't tell me much...
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
User avatar
jvdz
Posts: 2269
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: JSON API errors

Post by jvdz »

Something to do with URL-Encoding, which is performed automatically with the browser?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest