2

I cant find the solution anywhere and mine doesn't seem to work. I just want to see the last plate string in the browser,or the few last plates,doesn't matter.

http://login:password@MY.IP/ISAPI/Traffic/channels/1/vehicleDetect/plates/
<AfterTime><picTime>2021-12-09T09:07:15Z</picTime></AfterTime>

I do have a plate taken exactly at the time im using in pictime,but the result im getting is;

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ResponseStatus xmlns="
http://www.hikvision.com/ver20/XMLSchema
" version="2.0">
<requestURL>
/ISAPI/Traffic/channels/1/vehicleDetect/plates/
<AfterTime>
<picTime>2021-12-09T09:01:15Z</picTime>
</AfterTime>
</requestURL>
<statusCode>4</statusCode>
<statusString>Invalid Operation</statusString>
<subStatusCode>invalidOperation</subStatusCode>
</ResponseStatus>

POSTMAN
Edit:POSTMAN

Kuldeep J
  • 382
  • 5
  • 12
Master
  • 135
  • 1
  • 11

3 Answers3

2

Are you certain that the ISAPI setting is enabled in the camera configuration? It's not possible in the browser without some tool to send and process your API request. Have you tried using Postman? Don't forget to use a Digest Auth header.

wbg0
  • 36
  • 3
  • Hi,thanks for the answer.Tbh I'm not sure that ISAPI is enabled in the camera configuration. Do you have any idea where i should mark this option? I can't seem to find it. And yes,i have tried using postman. The thing that MAY BE the problems is that i do not have an SD card in my camera. Do you know if this could be the problem? – Master Dec 17 '21 at 11:29
  • There is no need for an SD card to request something from the API. In my camera it is called Hikvision-CGI under Network->Advanced -> Integration Protocol. Make sure it's set to enabled and authentication set to digest/basic – wbg0 Dec 17 '21 at 12:24
  • Yes,i checked it,and sadly,they were already marked like you said. Okay,i don't need the SD card to request something from the API,but i believe that to get the plate results i would need one,right? Sometimes it does return the url to me with 'No results found',even tho i know there are some – Master Dec 17 '21 at 12:52
  • 1
    It can pass you the last 20 plates without a SD card. In Postman, Authorization tab -> select Type = Digest Auth, enter your admin credentials for the camera there. Select the "Body" tab -> click "raw" radio button -> a little to the right of this you can select XML from the dropdown. Enter this: "%s" and make sure to send the request as GET to this url: http://CAMERA_IP:PORT/ISAPI/Traffic/channels/1/vehicleDetect/plates – wbg0 Dec 17 '21 at 16:27
  • Hi. I have tried done exactly what you said. I know it SHOULD work,i have seen a lot of people using this URL,but it still returns me with "Invalid Operation". I edited my post and linked an image with my postman results. Note: the 'Authorization' is 100% correct,have checked it countless times. – Master Dec 17 '21 at 17:23
  • Just to be safe, can you tell me what camera you have and what firmware version? And what port are you using? (it should be the http port) – wbg0 Dec 18 '21 at 10:05
  • Hi,sorry for taking so long,but i do not have access to the camera on weekends. My camera is Hikvision DeepinView iDS-2CD7A26G0/P-IZHS . My firmware version is V5.5.130 build 200927 . And the HTTP port im using is 80 – Master Dec 20 '21 at 11:31
  • Hi, that's the exact same camera I've tried this on. 1 more step I took for which I have no logic but that was to create an extra user on the Integration Protocol tab with the same credentials as the regular admin user. – wbg0 Dec 21 '21 at 12:35
  • And can you tell me if your firmware version is the same as mine? I will try creating another user – Master Dec 21 '21 at 13:12
  • Not the same version. I tried and confirmed it working for 5.5.130 (210510) and 5.5.130(211018). My reason for upgrading was that the listening server setting was not functioning properly. Firmware can be found here: https://www.hikvisioneurope.com/eu/portal/?dir=portal/Technical%20Materials/00%20%20Network%20Camera/00%20%20Product%20Firmware/H7%20Platform%28iDS-2CD7XXX%29/iDS-2CD7XXX%27P – wbg0 Dec 21 '21 at 18:17
0
from requests.auth import HTTPDigestAuth
import requests
url = 'http://<Your IP>/ISAPI/Traffic/channels/1/vehicleDetect/plates/'
data = "<AfterTime><picTime>20220912T192011+0400</picTime></AfterTime>"
r=requests.get(url, data =data,auth=HTTPDigestAuth('admin', 'password'))
print(r.text)

Try this one after enabling this setting in camera
Screenshot
enter image description here

Kuldeep J
  • 382
  • 5
  • 12
0

You have to send a PUT request and is better if you add username and password on Auth Digest.

You can do all that on Postman.