Where is the API portal URL stored?

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
BaconButty
Posts: 41
Joined: Fri Jun 12, 2020 1:29 pm

Where is the API portal URL stored?

Post by BaconButty »

I know this is a really basic question, and maybe it's just as I've had a rough week, but I can't find where the API URL is being got for the following failures:
3966 INF |----> FORK:Cam5-RSMF-Back Garden (11), eid:2912365 Not sending event end alarm, as we did not send a start alarm for this, or start hook processing failed zmeventnotification.pl -
5/15/25, 11:52:32 PM GMT+1 zmesdetect_m11 4429 FAT Unrecoverable error:404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.json Traceback:Traceback (most recent call last): File "/var/lib/zmeventnotification/bin/zm_detect.py", line 556, in <module> main_handler() File "/var/lib/zmeventnotification/bin/zm_detect.py", line 335, in main_handler zmapi = zmapi.ZMApi(options=api_options) File "/usr/local/lib/python3.8/dist-packages/pyzm/api.py", line 76, in __init__ self._login() File "/usr/local/lib/python3.8/dist-packages/pyzm/api.py", line 225, in _login raise err File "/usr/local/lib/python3.8/dist-packages/pyzm/api.py", line 195, in _login r.raise_for_status() File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self)requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.json zm_detect.py 561
5/15/25, 11:52:32 PM GMT+1 zmesdetect_m11 4429 ERR Got API login error: 404 Client Error: Not Found for url: http://192.168.178.69/zm/api/host/login.json api.py 223
I've checked all the config files and ensure they're changed, but I'm still getting this error.

For a bit of background, I moved a lot of the stuff hosted on that server to nginx last week and moved apache to a different port, so need to change the zone minder portal to 127.0.0.1:5557 instead of just 127.0.0.1

Thanks in advance.
User avatar
burger
Posts: 472
Joined: Mon May 11, 2020 4:32 pm

Re: Where is the API portal URL stored?

Post by burger »

There is an explanation here: https://wiki.zoneminder.com/API#Troubleshooting
What you need to know is that the api is NOT at /usr/share/zoneminder/www/api but in fact is located at

/usr/share/zoneminder/www/api/app/webroot
Maybe the redirect rules in the web server config are broken?
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
BaconButty
Posts: 41
Joined: Fri Jun 12, 2020 1:29 pm

Re: Where is the API portal URL stored?

Post by BaconButty »

I think we're talking about different things.

Somewhere in one of the configs (that I can't find) the api portal is listed as "127.0.0.1/zm". I need to change this to "127.0.0.1:5557/zm", but I can't find where this is configured.
User avatar
burger
Posts: 472
Joined: Mon May 11, 2020 4:32 pm

Re: Where is the API portal URL stored?

Post by burger »

Sorry, I didn't read closely enough. Reading the error again, it looks like a ZMES misconfiguration. Try the ZMES secrets.ini file. That has ZM_PORTAL, ZM_API_PORTAL, and ZMES_PICTURE_URL. On my system that file is in /etc/zm.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
BaconButty
Posts: 41
Joined: Fri Jun 12, 2020 1:29 pm

Re: Where is the API portal URL stored?

Post by BaconButty »

Ah you legend!

I was sure I did check the secrets file, and I *did*. I forgot I had a broken install in this that was abandoned and that's the secret ini that I must have been editing. Thanks for the correct lcoation!!! Working now :)
Post Reply