The API documentation says that calling curl http://server/zm/api/monitors.json (naturally with "server" replaced with my server address) should return a list of all monitors. Unfortunately, this does not seem to be the case. After successfully logging in to the server, I get the response "message Monitor Name must be specified for creation, Monitor Name must be specified for creation," After some debugging the ZM PHP code, I find that the error message is generated in the function MonitorsController::add() at around line 126. Am I missing an extra parameter with the call to api/monitors.json?
Incidentally, I am using ZoneMinder version 1.36.34, running Ubuntu 24.04.2 LTS in a VirtualBox virtual machine.
Any help would be much appreciated.
David Singleton
Problem calling http://server/zm/api/monitors.json
-
- Posts: 3
- Joined: Tue Jul 09, 2024 5:03 am
Re: Problem calling http://server/zm/api/monitors.json
That code gets run when you do a POST. Your command line as listed should not be doing a POST. It should be doing a GET. So something is strange. Is that actually the command line you are using?
-
- Posts: 3
- Joined: Tue Jul 09, 2024 5:03 am
Re: Problem calling http://server/zm/api/monitors.json
Silly me!!!
When I look at the documentation again, it is obvious that I should use a GET (default) and not a POST (as I used for the login)! I have updated my code, and all now seems to be working as it should.
Many thanks for the help.
Best wishes
David Singleton
When I look at the documentation again, it is obvious that I should use a GET (default) and not a POST (as I used for the login)! I have updated my code, and all now seems to be working as it should.
Many thanks for the help.
Best wishes
David Singleton