API not working

Forum for questions and support relating to the 1.30.x releases only.
Locked
claudioita
Posts: 7
Joined: Tue Dec 13, 2016 12:08 pm

API not working

Post by claudioita »

Newb here. ZOneminder 1.30.4 under Ubuntu 17.10

http://192.168.1.12/zm/index.php
works fine.

http://192.168.1.12/zm/api/host/getVersion.json
brings nothing.

Tried to install zmninja and says API not working.

But I have no idea what an API is, and how to check.

Any help? Thanks
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: API not working

Post by bbunge »

Known issue. There is a prior forum post about this. Alt install procedure at:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

I strongly recommend you go back to Ubuntu 16.04!
akg1508
Posts: 26
Joined: Sun Aug 02, 2015 9:06 am

Re: API not working

Post by akg1508 »

The API is what allows external programs such as zmNinja to access zoneminder, it stands for Application Programming Interface (from memory).

First you'll need to ensure that the API is installed, my Ubuntu 16.04 1.30.x installation has it in /usr/share/zoneminder/www/api.

The ensure that it is enabled, i.e. OPT_USE_API is checked in the System config.

Also take a look at: http://zoneminder.readthedocs.io/en/stable/api.html

(There's no point playing with zmNinja until you've got the curl commands working :-))

HTH,
Alistair
claudioita
Posts: 7
Joined: Tue Dec 13, 2016 12:08 pm

Re: API not working

Post by claudioita »

bbunge wrote: Fri Nov 03, 2017 12:22 pm Known issue. There is a prior forum post about this. Alt install procedure at:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

I strongly recommend you go back to Ubuntu 16.04!
you mean with the alternative procedure will work? Or do I need to do a Ubuntu 16.04?
claudioita
Posts: 7
Joined: Tue Dec 13, 2016 12:08 pm

Re: API not working

Post by claudioita »

akg1508 wrote: Fri Nov 03, 2017 12:27 pm The API is what allows external programs such as zmNinja to access zoneminder, it stands for Application Programming Interface (from memory).

First you'll need to ensure that the API is installed, my Ubuntu 16.04 1.30.x installation has it in /usr/share/zoneminder/www/api.

The ensure that it is enabled, i.e. OPT_USE_API is checked in the System config.

Also take a look at: http://zoneminder.readthedocs.io/en/stable/api.html

(There's no point playing with zmNinja until you've got the curl commands working :-))

HTH,
Alistair

yes the directory has files inside (not sure if are the right ones)
yes the OPT_USE_API is checked in the System config.
claudioita
Posts: 7
Joined: Tue Dec 13, 2016 12:08 pm

Re: API not working

Post by claudioita »

when I ran this I receive no answer

claudio@NUC-UBUNTU:~$ curl http://192.168.1.12/zm/api/monitors/1.json
claudio@NUC-UBUNTU:~$ curl http://192.168.1.12/zm/api/host/getVersion.json
claudio@NUC-UBUNTU:~$ curl http://192.168.1.12/zm/api/host/getVersion.json
claudio@NUC-UBUNTU:~$
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: API not working

Post by bbunge »

claudioita wrote: Fri Nov 03, 2017 12:31 pm
bbunge wrote: Fri Nov 03, 2017 12:22 pm Known issue. There is a prior forum post about this. Alt install procedure at:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

I strongly recommend you go back to Ubuntu 16.04!
you mean with the alternative procedure will work? Or do I need to do a Ubuntu 16.04?
yes to both questions.
You can play with your 17.10 setup for a long time and not get it to work. 16.04 is what i recommend!
claudioita
Posts: 7
Joined: Tue Dec 13, 2016 12:08 pm

Re: API not working

Post by claudioita »

bbunge wrote: Fri Nov 03, 2017 4:55 pm
claudioita wrote: Fri Nov 03, 2017 12:31 pm
bbunge wrote: Fri Nov 03, 2017 12:22 pm Known issue. There is a prior forum post about this. Alt install procedure at:
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

I strongly recommend you go back to Ubuntu 16.04!
you mean with the alternative procedure will work? Or do I need to do a Ubuntu 16.04?
yes to both questions.
You can play with your 17.10 setup for a long time and not get it to work. 16.04 is what i recommend!
Ok, I have nothing installed I can do a fresh install. Ubunty 16 desktop or server?
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: API not working

Post by bbunge »

claudioita wrote: Fri Nov 03, 2017 6:07 pm
bbunge wrote: Fri Nov 03, 2017 4:55 pm
claudioita wrote: Fri Nov 03, 2017 12:31 pm

you mean with the alternative procedure will work? Or do I need to do a Ubuntu 16.04?
yes to both questions.
You can play with your 17.10 setup for a long time and not get it to work. 16.04 is what i recommend!
Ok, I have nothing installed I can do a fresh install. Ubunty 16 desktop or server?
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
Locked