Page 1 of 1

API Documentation

Posted: Mon Feb 08, 2010 10:31 pm
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

Posted: Mon Feb 08, 2010 10:44 pm
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.

.

Posted: Mon Feb 08, 2010 10:58 pm
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.

Posted: Tue Feb 09, 2010 1:39 am
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.

Posted: Tue Feb 09, 2010 1:55 am
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.

Changes

Posted: Tue Feb 09, 2010 1:07 pm
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?

Posted: Tue Feb 09, 2010 4:03 pm
by mitch
user contributions.

Great!

Posted: Tue Feb 09, 2010 7:40 pm
by VT3Ch
That's great! Thanks! :D