API not working in 1.37.47

Current Development version likely to have breaking changes
Post Reply
geraldbrandt
Posts: 132
Joined: Tue Dec 09, 2014 10:20 pm

API not working in 1.37.47

Post 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:~# 
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: API not working in 1.37.47

Post 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.
geraldbrandt
Posts: 132
Joined: Tue Dec 09, 2014 10:20 pm

Re: API not working in 1.37.47

Post 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"
Post Reply