Obtendo Registros de Eventos
Eventos de Acesso

Obter Registros de Acesso

Por meio da chamada abaixo é possível obter os eventos de acessos registrados no dispositivo.

Requisição - GET

http://192.168.1.201/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCardRec&StartTime=1588784120&EndTime=1588784110

paramtypedescription
AccessControlCardRec *StringComando para obter Histórico de Acessos
StartTimeTimestampData Inicio do Evento, exemplo: 1629739780
EndTimeTimestampData Fim do Evento, exemplo: 1629739780

Exemplo de Retorno - text/plain

found=27
records[0].AttendanceState=0
records[0].CardName=
records[0].CardNo=
records[0].CardType=0
records[0].CreateTime=1629710275
records[0].Door=0
records[0].ErrorCode=16
records[0].Mask=0
records[0].Method=15
records[0].Notes=
records[0].Password=
records[0].ReaderID=1
records[0].RecNo=1
records[0].RemainingTimes=0
records[0].ReservedInt=0
records[0].ReservedString=
records[0].RoomNumber=
records[0].Status=0
records[0].Type=Entry
records[0].URL=/mnt/appdata1/userpic/SnapShot/2021-08-23/17/17/0_100_20210823171755760.jpg
records[0].UserID=
records[0].UserType=0
records[1].AttendanceState=0
records[1].CardName=
records[1].CardNo=
records[1].CardType=0
records[1].CreateTime=1629710312
records[1].Door=0
records[1].ErrorCode=0
records[1].Mask=0
records[1].Method=5
records[1].Notes=
records[1].Password=
records[1].ReaderID=1
records[1].RecNo=2
records[1].RemainingTimes=0
records[1].ReservedInt=0
records[1].ReservedString=
records[1].RoomNumber=
records[1].Status=1
records[1].Type=Entry
records[1].URL=
records[1].UserID=
records[1].UserType=0
records[2].AttendanceState=0
records[2].CardName=
records[2].CardNo=
records[2].CardType=0
records[2].CreateTime=1629710314
records[2].Door=0
records[2].ErrorCode=0
records[2].Mask=0
records[2].Method=5
records[2].Notes=
records[2].Password=
records[2].ReaderID=1
records[2].RecNo=3
records[2].RemainingTimes=0
records[2].ReservedInt=0
records[2].ReservedString=
records[2].RoomNumber=
records[2].Status=1
records[2].Type=Entry
records[2].URL=
records[2].UserID=
records[2].UserType=0
records[3].AttendanceState=0
records[3].CardName=
records[3].CardNo=
records[3].CardType=0
records[3].CreateTime=1629710323
records[3].Door=0
records[3].ErrorCode=0
records[3].Mask=0
records[3].Method=5
records[3].Notes=
records[3].Password=
records[3].ReaderID=1
records[3].RecNo=4
records[3].RemainingTimes=0
records[3].ReservedInt=0
records[3].ReservedString=
records[3].RoomNumber=
records[3].Status=1
records[3].Type=Entry
records[3].URL=
records[3].UserID=
records[3].UserType=0

Exemplos

import requests
 
device_ip = '192.168.3.87'
username = 'admin'
password = 'acesso1234'
 
start_time = '1588784120'
end_time = '1588784110'
 
url = "http://{}/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCardRec&StartTime={}&EndTime={}".format(
                                    str(device_ip),
                                    str(start_time),
                                    str(end_time),
                                )
digest_auth = requests.auth.HTTPDigestAuth(username, password)
rval = requests.get(url, auth=digest_auth, timeout=20, verify=False)
 
print(rval.text)