API validation question
Posted: Sun Jul 14, 2019 12:26 am
I am running ZoneMinder 1.32 on a Ubuntu 18.04 server. Everything is working fine. I was trying to setup zmNinga but it says my api is not working. I did all of the test on the Validating APIs on https://zmninja.readthedocs.io/en/lates ... g-api.html all of the steps work correctly until I get to step 6.
Step 6: (If you find your APIs show ok, but zmNinja has issues)
Open a browser, log into ZM
Open a new tab, enter http://server/zm/api/host/getVersion.json
Now, right click and do a View Source in your browser (different browsers may have different names for it). This brings up a full source code view of the page. Do you ONLY see the JSON output or do you see gobs of HTML on top like <pre class= and lots of cake related messages? If you do, you need to fix it.
When I enter http://server/zm/api/host/getVersion.json I get the correct response
When I View Source (my case View Page Source) I only get the json I do not see any HTML. Honestly I am not sure which response is correct only seeing only json or seeing HTML? if seeing json only is incorrect does anybody know what to do to fix it?
I am using the API to interface with Home Assistant and it does appear to be working.
Step 6: (If you find your APIs show ok, but zmNinja has issues)
Open a browser, log into ZM
Open a new tab, enter http://server/zm/api/host/getVersion.json
Now, right click and do a View Source in your browser (different browsers may have different names for it). This brings up a full source code view of the page. Do you ONLY see the JSON output or do you see gobs of HTML on top like <pre class= and lots of cake related messages? If you do, you need to fix it.
When I enter http://server/zm/api/host/getVersion.json I get the correct response
Code: Select all
{
"version": "1.32.3",
"apiversion": "1.0"
}
I am using the API to interface with Home Assistant and it does appear to be working.