01304 827609 info@use-ip.co.uk Find us

Help with ISAPI / API

CCTVGUY99

Well-Known Member
Messages
54
Points
8
DE23C2FB-7289-45BE-8F73-C25D31316B76.jpeg
Hi Guru’s I need some help!

so I came across an osd in hik-connect on a hik camera that used ISAPI (little to no knowledge on this) to overlay the battery voltage onto the OSD.

this would be super useful and after a lot of head banging I found this document that explains briefly how this is done at section 8.4.52:
ISAPI page: 8.4.52

what I need to know is how do I actually implement this? I have spent days on google and this forum trying to find answers but got nowhere?!

there must be an expert here who can teach me specifically how to do this and not just hit me with wrong answers?

oh and for those about to ask... yes the voltage is live and yes I have seen it change...
 

Attachments

  • C00CED8B-9E62-446A-B4DB-A6191A0B13D7.jpeg
    C00CED8B-9E62-446A-B4DB-A6191A0B13D7.jpeg
    132 KB · Views: 317
You can interact with the ISAPI interface using a cURL tool on a command line terminal window. I use Linux so tools like curl are fairly standard, if you are on Windows I don't know if it includes curl or if you can download a curl tool but assuming you get a curl tool...

So cURL is basically just a command line interface to GET (receive) data or PUT (send) http/https data.

I use ISAPI in a script to reboot some cameras which regularly crash for some reason so taking that as a simple example I send a PUT request to a camera (I am not actually sending any data in this example, as the reboot command does not need any data):
Code:
curl -X PUT "http://admin:PASSWORD@CAMERA_IP/ISAPI/System/reboot"
Obviously replacing PASSWORD and CAMERA_IP with the relevant details. This is of course sending an admin password in clear text over the network. You certainly would NOT want to do that over the internet, but for a private network and to keep thing simple for this example let's go with it...

All going well the camera reboots.

So for your overlay I suggest you send a GET request to the camera to confirm you can get it to work and see exactly what XML you get back:
Code:
curl -X GET "http://admin:PASSWORD@CAMERA_IP/ISAPI/System/Video/inputs/channels/ID/overlays/BatteryPowerOverlay"
According to the spec it should return the BatteryPowerOverlay XML, which (I am guessing here) will show disabled.

Then to set to enabled you would probably need to send a PUT request with adjusted BatteryPowerOverlay XML data where the XML is set to enabled. Something like:
Code:
curl -X PUT "http://admin:PASSWORD@CAMERA_IP/ISAPI/System/Video/inputs/channels/ID/overlays/BatteryPowerOverlay" -d "YOUR XML HERE"
 
Last edited:
Ok this is super helpful and I have learned a lot just reading your post, where it says <ID> How do I find the camera Id? I have 4 connected to the nvr and would ideally like this overlaid on each individual camera
 
ok so obviously i have substituted the pasword and ip here but when i try your commands i get the following error:


C:\Users\secur>curl -X GET "http://admin:nope>@192.168.1.106/ISAPI/System/Video/inputs/channels/1/overlays/BatteryPowerOverlay"

<?xml version="1.0" encoding="UTF-8" ?>
<userCheck>
<statusValue>401</statusValue>
<statusString>Unauthorized</statusString>
</userCheck>

Any idea why this is?
 
Ok this is super helpful and I have learned a lot just reading your post, where it says <ID> How do I find the camera Id? I have 4 connected to the nvr and would ideally like this overlaid on each individual camera
If you are talking to the cameras direct then there will probably only be one channel with an ID of "1". If you are talking to the ISAPI interface of the NVR then of course the channel ID would be (I am guessing) 1 to <max NVR channels>

But to be sure, either way you would do a GET request on /ISAPI/System/Video/inputs and/or /ISAPI/System/Video/inputs/channels

Also don't forget that you may have to enable the ISAPI interface on the NVR or cameras beforehand, it may be disabled by default.
 
ok so obviously i have substituted the pasword and ip here but when i try your commands i get the following error:


C:\Users\secur>curl -X GET "http://admin:nope>@192.168.1.106/ISAPI/System/Video/inputs/channels/1/overlays/BatteryPowerOverlay"

<?xml version="1.0" encoding="UTF-8" ?>
<userCheck>
<statusValue>401</statusValue>
<statusString>Unauthorized</statusString>
</userCheck>

Any idea why this is?
Probably ISAPI interface is disabled on the camera. Go into the admin pages and find the setting and enable it. Probably in advanced network settings but not sure.

Also remove the > from your URL, sorry, my original post had a typo (now corrected).
 
Ok so checked and isapi has a tick in the box but is greyed out? That being said if I run

/ISAPI/system/capabilities I do get a loaded xml displayed?

image.jpg

image.jpg
 
I really appreciate all your help but i am having no luck at all, with your last command this is the result i got:


1613853842137.png
 
Try entering the username and password in the http string, like http://username:password@....
 
Back
Top