Page 1 of 1

API not working in 1.37.47

Posted: Thu Nov 16, 2023 2:30 pm
by geraldbrandt
I did a quick search, but could find anything that related to this.

I just upgraded a system from 1.36.33 to 1.37.47 using iconnor's master repo on Ubuntu 22.04.03. It was a clean upgrade, as far as I could tell.

I use the API to turn cameras to and from modect and monitor. It doesn't seem to work in 1.37.47. The command is successful, but the camera mode doesn't change. Is there something I missed in the forums that can point me in the right direction?

Code: Select all

root@zoneminder:~# /usr/bin/curl  -XPOST http://localhost/zm/api/monitors/3.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
{"message":"Saved"}root@zoneminder:~# 

Re: API not working in 1.37.47

Posted: Thu Nov 16, 2023 5:15 pm
by iconnor
Function is gone in 1.37. Use individual settings Capturing, Analysing, Recording, etc.

So turn off motion detection, set Analysing=None instead of Always.

Re: API not working in 1.37.47

Posted: Thu Nov 16, 2023 7:58 pm
by geraldbrandt
iconnor wrote: Thu Nov 16, 2023 5:15 pm Function is gone in 1.37. Use individual settings Capturing, Analysing, Recording, etc.

So turn off motion detection, set Analysing=None instead of Always.
Perfect, thank you! I figured I was missing something simple.

For those looking later, this turns off my motion detection recording:

Code: Select all

/usr/bin/curl  -XPOST http://localhost/zm/api/monitors/3.json -d "Monitor[Analysing]=None&Monitor[Recording]=None&Monitor[Enabled]=1"
and this turns on my motion detect recording:

Code: Select all

/usr/bin/curl  -XPOST http://localhost/zm/api/monitors/6.json -d "Monitor[Analysing]=Always&Monitor[Recording]=OnMotion&Monitor[Enabled]=1"