5.10.4 api log pull

The /api/log/pull helps you read items from the channel queue (subscription) and returns a list of events unread so far or an empty list if no new event is available. Larger amounts of events are pulled in batches of 128 events.

Use the timeout parameter to define the maximum time for the intercom to generate the reply. If there is one item at least in the queue, the reply is generated immediately. In case the channel queue is empty, the intercom puts off the reply until a new event arises or the defined timeout elapses.

The function is part of the Logging service and requires no special user privileges. Reading events is conditioned by the privilege allowing the user to monitor such events, refer to 5.10.2 api log subscribe for the event table.

The GET or POST method can be used for this function.

Request parameters:

Parameter

TypeMandatory

Default value

Description

id

uint32Yes

Identifier of the existing channel created by preceding dialling of /api/log/subscribe

timeoutuint32No0Define the reply delay (in seconds) if the channel queue is empty. The default value 0 means that the intercom shall reply without delay.

The reply is in the application/json format and includes a list of events.

Parameter

Type

Description

events

array

Event object array. If no event occurs during the timeout, the array is empty.

Example:

GET /api/log/pull
{

  "success" : true,
  "result" : {
    "events" : [
      {
        "id" : 1,
        "tzShift" : 0,
        "utcTime" : 1437987102,
        "upTime" : 8,
        "event" : "DeviceState",
        "params" : {
          "state" : "startup"
        }
      },
      {
        "id" : 3,
        "tzShift" : 0,
        "utcTime" : 1437987105,
        "upTime" : 11,
        "event" : "RegistrationStateChanged",
        "params" : {
          "sipAccount" : 1,
          "state" : "registered"
        }
      }
    ]
  }
}

Events

Each event in the events field includes the following common information:

ParameterTypeDescription
iduint32Internal event record ID (32bit number, 1 after intercom restart incremented with every new event)
utcTimeuint32Absolute event rise time (Unix Time, UTC)
upTimeuint32Relative event rise time (seconds after intercom restart)
tzShiftint32

Difference between the local time and Coordinated Universal Time (UTC) in minutes.

Add this value to utcTime to obtain the local time of event generation according to the device time zone:

localTime = utcTime + tzShift * 60

eventstringEvent type (KeyPressed, InputChanged, ...)
paramsobjectSpecific event parameters

DeviceState

Signals the device state changes.

Event parameters:

ParameterTypeDescription
statestring

Signalled device state:

startup – generated one-time after device start (always the first event ever)

Example:

{
  "id" : 1,
  "tzShift" : 0,
  "utcTime" : 1437987102,
  "upTime" : 8,
  "event" : "DeviceState",
  "params" : {
    "state" : "startup"
  }
}

AudioLoopTest

Signals performance and result of an automatic audio loop test. The event is signalled whenever the automatic test has been performed (either scheduled or manually started).

ParameterTypeDescription
resultstring

Result of an accomplished text:

passed – the test was carried out successfully, no problem has been detected.

failed – the test was carried out, a loudspeaker/microphone problem has been detected.

Example:

 {
  "id" : 26,
  "tzShift" : 0,
  "utcTime" : 1438073190,
  "upTime" : 9724,
  "event" : "AudioLoopTest",
  "params" : {
    "result" : "passed"
  }
}

MotionDetected

Signals motion detection via a camera. The event is available in camera-equipped models only. The event is generated only if the function is enabled in the intercom camera configuration. 

Event parameters:

Parameter
Type
Description
statestring

Motion detector state:

in – signals the beginning of the interval in which motion was detected.

out – signals the end of the interval in which motion was detected.

Example:

{
  "id" : 2,
  "tzShift" : 0,
  "utcTime" : 1441357589,
  "upTime" : 1,
  "event" : "MotionDetected",
  "params" : {
    "state" : "in"
  }
}

NoiseDetected

Signals an increased noise level detected via an integrated or external microphone. The event is generated only if this function is enabled in the intercom configuration. 

Event parameters:

Parameter
Type
Description
statestring

Noise detector state:  

in – signals the beginning of the interval in which noise was detected.

out – signals the end of the interval in which noise was detected.

Example:


{
  "id" : 2,
  "tzShift" : 0,
  "utcTime" : 1441357589,
  "upTime" : 1,
  "event" : "NoiseDetected",
  "params" : {
    "state" : "in"
  }
}

KeyPressed and KeyReleased

Signals pressing (KeyPressed) or releasing (KeyReleased) of speed dial or numeric keypad buttons. 

Event parameters:

ParameterTypeDescription
keystring

Pressed/released button code:

0 to 9 – numeric keypad buttons

%1%150 – speed dialling buttons

* – button with a * or phone symbol

# – button with a # or key symbol

Example:

{
  "id" : 4,
  "tzShift" : 0,
  "utcTime" : 1437987888,
  "upTime" : 794,
  "event" : "KeyPressed",
  "params" : {
    "key" : "5"
  }
}

CodeEntered

Signals entering of a user code via the numeric keypad. The event is generated in numeric keypad equipped devices only.

Event parameters:

ParameterTypeDescription
apstringAccess Point, available states: 0 = entry, 1 = exit
sessionstringInforms how many times the code has been entered.
directionstring

Code direction:

in – arrival

out – departure

any – passage

Note: Set the card reader direction using the intercom configuration interface.

codestringUser code, 1234, e.g. The code includes 2 digits at least and 00 cannot be used.
typestring
uuidstringUser's unique ID
validboolean

Code validity (i.e. if the code is defined as a valid user code or universal switch code in the intercom configuration):

false – invalid code

true – valid code

 

Example:

{
  "id" : 128,
  "tzShift" : 0,
  "utcTime" : 1548078453,
  "upTime" : 1061,
  "event" : "CodeEntered",
  "params" : {
    "ap" : 0,
    "session" : 8,
    "direction" : "in",
    "code" : "1234",
    "type" : "user",
    "uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
    "valid" : true
  }
}

CardEntered

Signals tapping an RFID card on the card reader. The event is generated in RFID card reader equipped devices only.

Event parameters:

ParameterTypeDescription
apstringAccess Point, available states: 0 = entry, 1 = exit
session
Informs how many times the card has been applied.
directionstring

RFID direction:

in – arrival

out – departure

any – passage

Note: Set the card reader direction using the intercom configuration interface.

readerstring

RFID card reader/Wiegand module name, or one of the following non-modular intercom model values:

internal – internal card reader (2N IP intercoms)

external – external card reader connected via the Wiegand interface

Note: Set the card reader name using the intercom configuration interface.

uidstringUnique identifier of the applied card (hexadecimal format, 6 - 16 characters depending on the card type)
uuidstringUser's unique ID
validboolean

Validity of the applied RFID card (if the card uid is assigned to one of the intercom users listed in the phonebook)

false – invalid card

true – valid card

Example:

{
  "id" : 60,
  "tzShift" : 0,
  "utcTime" : 1548078014,
  "upTime" : 622,
  "event" : "CardEntered",
  "params" : {
    "ap" : 0,
    "session" : 5,
    "direction" : "in",
    "reader" : "ext2",
    "uid" : "4BD9E903",
    "uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
    "valid" : true
  }
}

InputChanged and OutputChanged

Signals a state change of the logic input (InputChanged) or output (OutputChanged). Use the /api/io/caps function to get the list of available inputs and outputs.

Event parameters:

ParameterTypeDescription
portstring

I/O port name

stateboolean

Current I/O port logic state:

false – inactive, log. 0

true – active, log. 1

Example:

{
  "id" : 2,
  "tzShift" : 0,
  "utcTime" : 1437987103,
  "upTime" : 9,
  "event" : "OutputChanged",
    "params" : {
    "port" : "led_secured",
    "state" : false
  }
}

SwitchStateChanged

Signals a switch state change (refer to the intercom configuration in Hardware | Switches).

Event parameters:

ParameterTypeDescription
switchuint32

Switch number 1...4

stateboolean

Current logic state of the switch:

false – inactive, log.0

true – active, log.1

originatorstring

Informs how the switch was activated.

profile – by transition to the preset active time profile.

api – by http api (api/switch/ctrl).

ap – by user authentication at the access point. The event is then completed with app and session.

rex – by pressing the exit button (that opens the door for a defined period of time for the person to leave the room).

idt – by http api (api/switch/ctrl) if special authentication for 2N® Indoor Touch 2.0, 1.0 was used.

dtmf – by dtmf code in the call.

auth – authorization by a user / universal / zone code.

uni – universal code authorization.

zone – zone code authorization.

automation – by an automation action.


Example:

{
  "id" : 2,
  "tzShift" : 0,
  "utcTime" : 1437987103,
  "upTime" : 9,
  "event" : "SwitchStateChanged",
    "params" : {
        "switch" : 1,
        "state" : true
  }
}

CallStateChanged

Signals a setup/end/change of the active call state.

Event parameters:

ParameterTypeDescription
directionstring

Call direction:

incoming – incoming call

outgoing – outgoing call

statestring

Current call state:

connecting – call setup in progress (outgoing calls only)

ringing – ringing

connected – call connected

terminated – call terminated

peerstringSIP URI of the calling (incoming calls) or called (outgoing calls) subscriber
sessionuint32

Unique call identifier. Can also be used in the /api/call/answer, /api/call/hangup and /api/call/status functions.

calluint32

TBD

Example:

 {
  "id" : 5,
  "tzShift" : 0,
  "utcTime" : 1438064126,
  "upTime" : 660,
  "event" : "CallStateChanged",
  "params" : {
    "direction" : "incoming",
    "state" : "ringing",
    "peer" : "sip:2229@10.0.97.150:5062;user=phone",
    "session" : 1,
    "call" : 1
  }
}

RegistrationStateChanged

Signals a change of the SIP account registration state. 

Event parameters:

ParameterTypeDescription
sipAccountuint32

SIP account number showing a state change:

1 – SIP account 1

2 – SIP account 2

statestring

New SIP account registration state:

registered – account successfully registered

unregistered – account unregistered

registering – registration in progress

unregistering – unregistration in progress


Example:

{
  "id" : 3,
  "tzShift" : 0,
  "utcTime" : 1437987105,
  "upTime" : 11,
  "event" : "RegistrationStateChanged",
  "params" : {
    "sipAccount" : 1,
    "state" : "registered"
  }
}

TamperSwitchActivated

Signals tamper switch activation - device cover opening. Make sure that the tamper switch function is configured in the Digital Inputs | Tamper Switch menu.

Event parameters:

ParameterTypeDescription
statestring

Tamper switch state:

in – signals tamper switch activation (i.e. device cover open).

out – signals tamper switch deactivation (device cover closed).

Example:

{
  "id" : 54,
  "tzShift" : 0,
  "utcTime" : 1441357589,
  "upTime" : 158,
  "event" : "TamperSwitchActivated",
  "params" : {
    "state" : "in"
  }
}

UnauthorizedDoorOpen

Signals unauthorized door opening. Make sure that a door-open switch is connected to one of the digital inputs and the function is configured in the Digital Inputs | Door State menu.

Event parameters:

ParameterTypeDescription
statestring

Unauthorized door opening state:

in – signals the beginning of the unauthorized opening state.

out – signals the end of the unauthorized door opening state.

Example:

{
  "id" : 80,
  "tzShift" : 0,
  "utcTime" : 1441367842,
  "upTime" : 231,
  "event" : "UnauthorizedDoorOpen",
  "params" : {
    "state" : "in"
  }
}

DoorOpenTooLong

Signals an excessively long door opening or failure to close the door within a timeout. Make sure that a door-open switch is connected to one of the digital inputs and the function is configured in the Digital Inputs | Door State menu.

Event parameters:

ParameterTypeDescription
statestring

DoorOpenToo Long state:

in – signals the beginning of the DoorOpenTooLong state.

out – signals the end of the DoorOpenTooLong state.

Example:

{
  "id" : 96,
  "tzShift" : 0,
  "utcTime" : 1441369745,
  "upTime" : 275,
  "event" : "DoorOpenTooLong",
  "params" : {
    "state" : "out"
  }
}

LoginBlocked

Signals a temporary blocking of the web interface access due to repeated entering of an invalid login name or password.

Event parameters:

ParameterTypeDescription
addressstring

IP address from which invalid data were entered repeatedly.

Example:

{
  "id" : 5,
  "tzShift" : 0,
  "utcTime" : 1441369745,
  "upTime" : 275,
  "event" : "LoginBlocked",
  "params" : {
    "address" : "10.0.23.32"
  }
}

UserAuthenticated

Signals user authentication and subsequent door opening.

Event parameters:

ParameterTypeDescription
apstringAccess Point, available states: 0 = entry, 1 = exit
sessionstringInforms how many times the user has been authenticated.
name string

Specifies the name of the phone book user.

uuid stringUser's unique ID
apbBroken string

Tapped card validity in Anti-passback.

false – inactive soft APB

true – active and broken soft ABP



Example:

{
  "success" : true,
  "result" : {
    "events" : [
      {
        "id" : 65,
        "tzShift" : 0,
        "utcTime" : 1593606655,
        "upTime" : 7951,
        "event" : "UserAuthenticated",
        "params" : {
          "ap" : 0,
          "session" : 6,
          "name" : "Alice Gruberov\u00E1",
          "uuid" : "8fa29ebc-2fe8-4a8c-9a3b-d8b0351fb6f8",
          "apbBroken" : true
        }
      }
    ]
  }
}

CardHeld

Signals that an RFID card has been tapped on the reader for more than 4 s.

Event parameters:

ParameterTypeDescription
ap string

 Access Point, available states: 0 = entry, 1 = exit

session string

Informs how many times the card has been applied.

direction string RFID direction:

in – arrival

out – departure

any – passage

Note: Set the card reader direction using the intercom configuration interface.

reader stringIdentification of the reader that read the card.
uid stringUser uid for devices connected to the Access Commander only. Devices disconnected from the Access Commander do not send this parameter.
valid string true, false

Example:

{    
  "id" : 9,
  "tzShift" : 0,
  "utcTime" : 1516893493,
  "upTime" : 354,
  "event" : "CardHeld",
  "params" : {
    "ap" : 1,
    "session" : 4,
    "direction" : "out",
    "reader" : "ext2",
    "uid" : "3F00F318E7",
    "valid" : true
   }
}

SilentAlarm

Signals silent alarm activation.

Event parameters:

ParameterTypeDescription
ap string

 Access Point, available states: 0 = entry, 1 = exit.

session string

Informs how many silent alarms have been activated.

name stringSpecifies the phonebook username.


Example:

{
  "id" : 200,
  "tzShift" : 0,
  "utcTime" : 1548079445,
  "upTime" : 2053,
  "event" : "SilentAlarm",
  "params" : {
    "ap" : 0,
    "session" : 17,
    "name" : "Joseph",
    "uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c"
  }
}

 


AccessLimited

Signals rejection of the set user.

Event parameters:

ParameterTypeDescription
apstringAccess Point, available states: 0 = entry, 1 = exit.
typestringcard, code, finger

state

string

State, available values: in = active, out = inactive.

  Example:

{
	"id" : 408,
	"tzShift" : 0,
	"utcTime" : 1517302112,
	"upTime" : 408951,
	"event" : "AccessLimited",
	"params" : {
	  "ap" : 0,
	  "type" : "card",
	  "state" : "in"
	}
}

 


PairingStateChanged

Signals pairing with a Bluetooth interface.

Event parameters:

ParameterTypeDescription

state

string

pending

authIdstring

Authorisation ID

Example: 


{
  "id" : 197,
  "tzShift" : 0,
  "utcTime" : 1516894499,
  "upTime" : 1360,
  "event" : "PairingStateChanged",
  "params" : {
    "state" : "pending",
    "authId" : "F2CAE955C9B4E81CD00E3A096E52543B"
  }
}

 

SwitchesBlocked

Signals lock blocking by the tamper switch. If the function is enabled, all the switches get blocked for 30 minutes whenever the tamper is activated. Blocking is active even after the device restart

Event parameters:

ParameterTypeDescription

state

string

in, out

Example:

{
  "id" : 205,
  "tzShift" : 0, "utcTime" : 1516894667,
  "upTime" : 1528,
  "event" : "SwitchesBlocked",
  "params" : {
    "state" : "in"
  }
}


FingerEntered

Signals that a finger has been tapped on the biometric reader.

Event parameters:

Parameter
Type
Description
 apstring Access Point, available states: 0 = entry, 1 = exit.
 sessionstring Informs how many times the finger has been enrolled.
direction string 

Fingerprint reader passage direction:

"in" – entry

"out" – exit

"any" – any direction

Note: Set the reader passage direction via the intercom configuration interface.

uuidstringUser's unique ID
validstring

Fingerprint validity (if available as a valid user fingerprint in the configuration)

false – invalid fingerprint

true – valid fingerprint


Example:  Reading of a user's fingerprint


{
  "id" : 1368,
  "tzShift" : 0,
  "utcTime" : 1548145535,
  "upTime" : 62598,
  "event" : "FingerEntered",
  "params" : {
    "ap" : 0,
    "session" : 1,
    "direction" : "in",
    "valid" : false
  }
}

Unsuccessful specification:  Reading of an unset user's fingerprint


{
    "id" : 14,
    "tzShift" : 0,
    "utcTime" : 1511859513,
    "upTime" : 65887,
    "event" : "FingerEntered",
    "params" : {
        "session" : 3,
        "valid" : false
    }
}

MobKeyEntered

Signals Bluetooth reader authentication.

Event parameters:

Parameter
Type
Description

ap

string

Access Point, available states: 0 = entry, 1 = exit.

session

string

Informs how many times the Mobile KEY authorisation has been applied.

direction

string

Passage direction:

"in" – entry

"out" – exit

"any" – any direction

Note: Set the reader passage direction via the intercom configuration interface.

authid

string

Mobile Key ID.
uuidstringUser's unique ID

valid

string

Mobile Key validity (if available as a valid user Mobile Key in the configuration)

false – invalid Mobile Key

true – valid Mobile Key


Example:

{
  "id" : 161,
  "tzShift" : 0,
  "utcTime" : 1548079174,
  "upTime" : 1782,
  "event" : "MobKeyEntered",
  "params" : {
    "ap" : 0,
    "session" : 9,
    "direction" : "in",
    "authid" : "48c48155eed7ea1dbb0b4d534b7459b9",
    "uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
    "valid" : true
  }
}

 


DoorStateChanged

Signals a door state change.

Event parameters:

ParameterTypeDescription

state

string

opened, closed


Example:

{
        "id" : 240,
        "tzShift" : 0,
        "utcTime" : 1516895295,
        "upTime" : 2156,
        "event" : "DoorStateChanged",
        "params" : {
          "state" : "opened"
        }     
}

 

UserRejected

Signals user authentication rejection.

Event parameters:

ParameterTypeDescription

ap

string

Access Point, available states: 0 = entry, 1 = exit.

sessionstringInforms how many times the authorisation has been rejected.
namestringUser name
uuidstringUser's unique ID
reasonstringaccessBlocked, switchLocked, invalidTime, invalidProfile, invalidSequence, invalidCredential, authInterrupted, timeout, switchDisabled


Example:

{
  "id" : 173,
  "tzShift" : 0,
  "utcTime" : 1548079274,
  "upTime" : 1882,
  "event" : "UserRejected",
  "params" : {
    "ap" : 0,
    "session" : 10,
    "name" : "Joseph",
    "uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
    "reason" : "invalidCredential"
  }
}

DisplayTouched

Signals display touch.

Event parameters:

ParameterTypeDescription

x

string

Display touch point coordinate. The maximum value depends of the display resolution.

ystringDisplay touch point coordinate.
dxstringCoordinate change due to movement on the display; negative values are possible. The maximum value depends of the display resolution.
dystringCoordinate change due to movement on the display.


Example:

{
	"id" : 337,
	"tzShift" : 0,
	"utcTime" : 1517301424,
	"upTime" : 408263,
	"event" : "DisplayTouched",
	"params" : {
	  "x" : 89,
 	  "y" : 100,
	  "dx" : 0,
	  "dy" : 0
	}
}

DtmfEntered

Signals a DTMF code in the call.

{
    "id" : 86,
    "tzShift" : 0,
    "utcTime" : 1558522871,
    "upTime" : 3531,
    "event" : "DtmfEntered",
    "params" : {
      "code" : "00",
      "type" : "uni",
      "call" : 3,
      "valid" : true
 }
}
ParameterTypeDescription

code

string

Display the code characters entered.

type string

The code type used.

uni – universal switch code

user – user code


call stringCall ID.
valid string

Code validity (i.e. the valid universal switch code or valid user code).

false – invalid code

true – valid code

AccessTaken

Signals that a card has been tapped in the Anti-passback area.

{
  "success" : true,
  "result" : {
    "events" : [

    ]
  }
}


 

ApLockStateChanged

Signals an emergency lockdown state change (on/off).

{
    "id" : 35,
    "tzShift" : 0,
    "utcTime" : 1558522465,
    "upTime" : 3125,
    "event" : "ApLockStateChanged",
    "params" : {
      "ap" : 0,
      "state" : "in"                    
    }
}
ParameterTypeDescription

ap

string

Access Point, available states: 0 = entry, 1 = exit.

state string

Status change state.

"in" – beginning of the emergency lockdown interval

"out" – end of the emergency lockdown interval

 


 

RexActivated

Signals the input activation set for the REX button.

{
    "id" : 29,
    "tzShift" : 0,
    "utcTime" : 1558522162,
    "upTime" : 2822,
    "event" : "RexActivated",
    "params" : {
      "ap" : 1,                           
      "session" : 1
    }
}
ParameterTypeDescription

ap

string

Access Point, available states: 0 = entry, 1 = exit.

session string

Display how many times the REX button has been activated.


 

LiftStatusChanged 

Signals the Lift Control module connection/disconection.

 
  {
        "id" : 2871,
        "tzShift" : 0,
        "utcTime" : 1561540370,
        "upTime" : 73822,
        "event" : "LiftStatusChanged",
        "params" : {
          "module" : 0,
          "ready" : true
        }
     
},
ParameterTypeDescription
modulestringDisplay the ID module.
readystring
 

LiftFloorsEnabled

Signals permanent access to a floor or permanent user access.

 
  {
        "id" : 2850,
        "tzShift" : 0,
        "utcTime" : 1561540011,
        "upTime" : 73463,
        "event" : "LiftFloorsEnabled",
        "params" : {
          "type" : "user" 
          "floors" : [
            0, 1, 2, 3, 4
          ],
          "uuid" : "621a5a49-1f8b-d34c-9a8b-881055864deb",
        }
      },

 

 {
        "id" : 2855,
        "tzShift" : 0,
        "utcTime" : 1561540016,
        "upTime" : 73468,
        "event" : "LiftFloorsEnabled",
        "params" : {
          "type" : "public" 
          "floors" : [
            1, 4
          ],
        }
      },
Parameter
Type
Description

type

string

Provides information on the access type.

public – change of public access

user – user authentication

floorsstring

Provides information on the accessible floors.

 

 

LifConfigChanged 

Signals a change in the lift control configuration.

 
 {
        "id" : 2860,
        "tzShift" : 0,
        "utcTime" : 1561540163,
        "upTime" : 73615,
        "event" : "LiftConfigChanged",
        "params" : {
          "hash" : 11
        }
      },

 

ParametrTypPopis

hash

string

Unique configuration code.


CapabilitiesChanged

Signals a change in available functions.

{   
  "success":true,
  "result":{      
   "events":[        
     {            
      "id":21,
      "tzShift":0,
      "utcTime":1585037151,
      "upTime":256,
      "event":"CapabilitiesChanged",
      "params":{
       
      }
      
     }


   ]
   
  }

}

 

ParameterTypeDescription

id

string

Event sequence number.

tzShiftuint32

Difference between the local time and UTC in minutes.

Add this value to utcTime to get the local time of event generation according to the time zone setting in the device:

localTime = utcTime + tzShift * 60

utcTimeuint32Absolute event generation time (Unix Time, UTC – Coordinated Universal Time).
upTimeuint32Relative event generation time (seconds after the intercom restart).
eventstringCapabilitiesChanged event type.
paramsobjectSpecific parameters of the event.