API Documentation

Forum for questions and support relating to the 1.24.x releases only.
Locked
VT3Ch
Posts: 4
Joined: Mon Feb 08, 2010 10:15 pm

API Documentation

Post by VT3Ch »

Hi,

I'm new here so please be gentle :) I'm just trying zomeminder out with Fedora 12 and two cameras. Both are connected via a bt card and it works great. I've been looking at some PTZ dome cameras and would like to control them via a non-web based app. So ...

Just a few hopefully simple questions for the gurus

1) Is there any documentation detailing the api and commands used to control zoneminder.

2) Ideally, I would like to get a list of cameras via xml and url video feeds. Possible?


Thanks
mitch
Posts: 169
Joined: Thu Apr 30, 2009 4:18 am

Post by mitch »

What you want is possible (see my patch http://www.zoneminder.com/forums/viewtopic.php?t=14008) but there is no documentation on the API as it really isn't a 'public' API. you have two options A) packetsniff when using the web frontend and doing what you want to do from your API, B) jump into the javascript and look at that. You can obviously look server side too but those are the easiest methods.
VT3Ch
Posts: 4
Joined: Mon Feb 08, 2010 10:15 pm

.

Post by VT3Ch »

I did read your post before posting my question. I tried your examples and got really confused :oops:

I'm currently using version 1.24.2

The url

http://127.0.0.1/zm/?view=api&action=list_monitors

gave me an error "View 'api' does not exist". not sure if your patch was included in this version.

and the url

http://127.0.0.1/zm/?view=request&reque ... c&usexml=1

didn't look familiar to me. not sure how to interpret that.. I would like to use the in-built mechanisms so my app will work on a stock zoneminder install. I could cook my own scripts but would like to avoid if possible.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Stock will not work, you would have to patch the source with mitch's patch to enable the xml.
If you want this on same same machine you can query the DB directly and for reference to PTZ you can look into the perl scripts that ZM uses to currently control the cameras.
mitch
Posts: 169
Joined: Thu Apr 30, 2009 4:18 am

Post by mitch »

Sorry for the confusion, the XML interface is only available with my patch, it may end up in the next public version but it is definitely not in the current version. As cordel mentioned you can directly access the sql backend and the perl scripts ZM uses if its something local, otherwise your only option with stock is to write an AJAX client as that is the only interface available on stock without my patch.
VT3Ch
Posts: 4
Joined: Mon Feb 08, 2010 10:15 pm

Changes

Post by VT3Ch »

Thanks for the replies. Sorry for the delay getting back here, I was banned from the forum after this first question but fixed now :D I'll write a few scripts to expose what I need. If they are any use to others can you suggest where I would post them?
mitch
Posts: 169
Joined: Thu Apr 30, 2009 4:18 am

Post by mitch »

user contributions.
VT3Ch
Posts: 4
Joined: Mon Feb 08, 2010 10:15 pm

Great!

Post by VT3Ch »

That's great! Thanks! :D
Locked