Reolink ipcamera API

wh@tever

Young grasshopper
Joined
Nov 7, 2017
Messages
39
Reaction score
2
hi, i think i need to use javascript to send the IR on and off commands to this camera. using fiddler it appears like this,

URL, http://192.168.x.x/cgi-bin/api.cgi?cmd=SetIsp&token=14793bb95763a49

under text view in fiddler it appears to send this,

[{"cmd":"SetIsp","action":0,"param":{"Isp":{"channel":0,"antiFlicker":"60HZ","exposure":"Auto","gain":{"min":1,"max":62},"shutter":{"min":1,"max":1},"blueGain":128,"redGain":128,"whiteBalance":"Auto","dayNight":"Black&White","backLight":"Off","blc":128,"drc":128,"rotation":0,"mirroring":0,"nr3d":1}}}]

can someone please tell me how to write this into a valid javascript format so i can run the script and it send the commands. i can figure out what the commands need to be i just don't know how to use the javascript syntax. thanks
 

pcunite

Young grasshopper
Joined
Jan 28, 2018
Messages
84
Reaction score
24
You probably don't need to send that entire JSON string in it's totality. Just send what you need to (but getting the cmd is probably required). If you do need to send everything, just follow what I've done here.


var oSend = { "cmd": "SetIsp", "action": 0, "param": { "Isp": { "channel": 0, "antiFlicker": "60HZ", "exposure": "Auto", "gain": { "min": 1, "max": 62 }, "shutter": { "min": 1, "max": 1 }, "blueGain": 128, "redGain": 128, "whiteBalance": "Auto", "dayNight": "Black&White", "backLight": "Off", "blc": 128, "drc": 128, "rotation": 0, "mirroring": 0, "nr3d": 1 } } }

var sSendStr = JSON.stringify(oSend);

// send sSendStr via createXHR object
 
Top