MAP HIK devices (doors) to Eco Time devices (option)
API Logs
Application Service Options
Configuring the API Client
Run the API application by clicking on the Eco HIK API shortcut on the desktop or running the application called EcoHIKAPI32 or EcoHIKAPIMs.
Select the Settings Tab on the Eco Time HIK API Client :
Server: The API server URL or IP address and port number as supplied by the client.
Authorization: The code is generated on the HIK server's REST client settings and supplied to Eco Time by teh client.
Version Number: The current API version number and cannot be changed.
Client Code: The client code defaults to "HIK" and cannot be changed.
Receive Format: The receive format is JSON and for information purposes only.
Stop timed events: This stops time-based events, typically useful when performing fault finding or analysing data on the client response screen.
Client API Type:This setting defaults to "HIK" and cannot be changed.
Client API Status:This is the default setting and cannot be changed.
Events Collect Interval: Events collected interval in hours and minutes.
Events / API Call: The maximum events collected with every events' API call.
Events Collect Position: The next position number where the API will collect events from. Set this value back to recollect all events.
Events Duplicate Threshold(ms): An event will not be saved as an Eco Time clocking if there is already and event with the current event time minus this value (100ms = 1 second). Duplicate events are saved as Info (Status = H) clockings.
Don't Save Duplicate Events : Duplicated events will be rejected and not be saved as Info clockings.
Don't Save Events To Clockings Table: Events are only stored in the Events table and not processed for Eco Time.
Events History Days: The number of days (defaults to 61) events must be stored in the Events table before they are deleted according to the event date.
Log History Records: The log history will be truncated at this number of records (default 2000).
Stop timed events: This stops time based events, typically useful when performing fault finding or analysing data on the client response screen.
Last Sync Date: The last date all persons and persons' info was synced.
Last Sync Time: The last time all persons and persons' info was synced.
Last Collect Date: The last date a timed collect of events was performed.
Last Collect Time: The last time a timed collect of events was performed.
1st Sync Time: The 1st time of day all persons and persons info will be synced.
2nd Sync Time: The 2nd time of day all persons and persons info will be synced.
Employee Division: Employees in HIK are allocated to this division.
Process for this division only: Select this option to limit the import of cardholders and events to the division set above.
Stop timed events: This stops time-based events, typically useful when performing fault finding or analysing data on the client response screen.
Run the API for the first time
After the API Client has been configured, run the application and select Settings tab and then the HIK sub tab.
Please note that the "Stop timed events" check box is disabled by default on a new API installation. There is no point running timed events until the configuration and device mapping have been completed.
Select the APi button next to the Version Number field. This will open the API Request Window
Now Press the Post (POST) button
You will see the request window is now populated with text. To verify the connection, select the response tab.
If the connection was successful, you should see at least a full page in the response field. Close API Request Window and verify that the version field is now populated. If there was a connection error, the following message with error description will pop up.
If the version field is not populated, go back to the API Request Window and look at the response tab or you will get a description of the error as a pop-up message .
If the response is very short, then the following errors are possible:
Server connection cannot be opened: The HIK server connection details are incorrect or a firewall is blocking the connection.
403 Unauthorized: The API operator does not have the privileges to view the monitored items.
403 Forbidden: The site does not have the API license:
The features to the API methods which are available to the POST API operator are controlled by the HIK user privileges. Eco Time needs the following API methods for integration:
Persons
Events
Readers
Doors
Devices
The "Do Not Process Response" disables any results processing. No tables will be populated. This is typically used for fault finding and in cases where you want to inspect the request packet and result packet.
Once you have established and tested that the HIK API Client is successfully communising with the HIK API Server, the HIK API Client must be loaded with the API information in the following sequence.
Devices
Doors
Readers
Persons
Setup the API for Eco Time integration
Start by populating the following lists in order by pressing the API button on the respective tabs:
Persons- Get Persons List: The persons button brings up the following popup menu:
Select the Get "Persons List" option by clicking on this item.
The persons table contains all the captured employees or visitors on the HIK system
The following persons table fields will be populated
ID: Internal HIK Person's ID code
Person Code: Person Code
Employee Number: Eco Employee number from the HIK custom field.
firstName: Persons holder first name
lastName: Persons holder last name
Authorised: Is the person authorised
ID Number: Person's ID or Passport number
Import Date: Date added to the Persons Holder's table.
Devices
Devices are HIK's main configuration entity. From here doors' (access devices) reader devices are attached. A device can be enabled or disabled. Events from a disabled device, its doors and its readers will be rejected
Doors
The doors table contains all the device names where employees or visitors can clock
The following doors table fields will be populated
Enabled: Set to 0 (zero) for disabled and 1 (one) for enabled. If a device is disabled, events will not be saved for that device.
ID: Internal HIK Door ID code
Access Device: HIK Access Device. Clockings are collected from Devices (Doors), but handled via the reader configuration.
Door Name: Door description as per the API sync process
Last Clocking Date Collected: Updated when events are collected for this device
Last Clocking Time Collected: Updated when events are collected for this device
Verified Date: The date on which the last Doors API sync was manually run. If this date does not match the last date on which the API was run, then the device was removed from the HIK system and can then manually be removed from this list.
Note: The HIK devices must be named with the extension Entry or Exit. This will enable the user in EcoTime to configure the corresponding device correctly.
Readers
The readers table contains all the readers names where employees or visitors can clock
The following reader table fields will be populated
Enabled: Set to 0 (zero) for disabled and 1 (one) for enabled. If a device is disabled, events will not be saved for that device.
ID: Internal HIK Door ID code
Reader Name: Clockings are collected from Devices (Doors) but handled via the reader configuration.
Door ID: Door ID as per the API sync process
Last Clocking Date Collected: Updated when events are collected for this device
Last Clocking Time Collected: Updated when events are collected for this device
Verified Date: The date on which the last Doors API sync was manually run. If this date does not match the last date on which the API was run, then the device was removed from the HIK system and can then manually be removed from this list.
Persons- PersonsInfo: The persons button brings up the following popup menu:
Select the "Get All PersonsInfo". This process will take some time and progress will be displayed at the bottom left of the HIK API Window.
The Persons Info option adds and updates the person's personal and custom information to the HIKPersons table:
Sites: If configured, the HIK Persons site is populated
Emp Number: This field is a mandatory configuration for HIK and Eco Time integration:"
This field is used to match the Eco Time employee number and if a match is found, the Eco Time fields will be populated.
If an Emp Number is not imported, no matching attempt will be made.
If an Emp Number is imported, the corresponding Eco Time details will be populated in the persons table:
Eco Emp Number
Eco Emp First Name
Eco Emp Last Name
If an Emp Number is imported, the API validates the employee surname and employee number.
If employee surname do not match, an error image will appear next to the cardholder.
The AP tries to match first names. If the firstnames do not match, the API tries to resolve initials or initials in combination with firstnames. But if this fails a warning image will appear next to the cardholder.
Division: Divisions which the employee is assigned to in the HIK system.
Department Business Unit: Department/Business Unit which the employee is assigned to in the HIK system.
Job Title: Job Title which the employee is assigned to in the HIK system.
Gender: gender of the employee is assigned to in the HIK system.
Verified Date: The last date the persons info was updated.
"Get Current Persons" Info option updates the currently selected person's personal and custom information to the Cardholders table.
"Get Current Persons Events" retrieves all the events of a selected person and updates the Events table according to the rules configure in the Readers Browse.
Mapping HIK Devices to Eco Time
The HIK API interface you allows the user to map the HIK devices to a corresponding Eco Time device.
In terms of using the HIK API, we recommend setting up and Eco Time API device, but you may use and existing device to ease the process of cutting over.
The browse has five fields which may be edited:
Enabled: Only enabled devices' events will be collected and displayed in the Events Browse. Enter a 1 to enable the device.
Name: This is the reader description
Eco Device: To map this device name to the corresponding Eco Time device, for example Eco Time Clock 1, simply enter 1 in this field.
TNA Clock: Update if events for this device must be assigned for TNA.
Access Clock: Update if events for this device must be assigned for Access.
Clock Direction: Assign direction to an event by enter 0 for not applicable (eg for Access), 1 for In, 2 for Out and 3 for toggle direction - must always be set
Once a HIK device has been mapped to an Eco Time Device, the event collected for that device is allocated all the attributes ascribed to that Eco Time device, for example if it is a Access, TNA or Job etc device. NOTE: The event direction will always be determined by the HIK Device Setting. Always map to an EcoTime API Device
If an Eco Time device mapping is not found for an enabled HIK device, the device settings configured in the readers browse for that device, will be used.
Manually Triggering the API
An API call can be manually triggered at any time by pressing the API button at the bottom of each browse.
An API call triggered will depend on the current tab selected (eg Events).
All manually triggered API calls are not automated. This means the API Client Request Window will open and you would manually have to press the Res (Get) button. Afterwards press the close button to exit the API call.
API Client Request Window Request:
API Client Request Window Response:
The API Status message at the bottom left of the browse will be updated with the current action or process.
Manually triggering an API is used during the configuration and setting up phase of the API.
It is also very helpful when performing fault finding. See the FAQ for more details about this.
Timed API Events
Timed events are automated events trigger either by time or an interval duration, in other words automated API calls.
During timed events the API Client Request Window is hidden but the API status message is updated.
There are three timed events:
New events are collected from the HIK server every two minutes.
The cards holders list is synced twice a day. Once at 1am and once at 1pm.
The cards holders information is updated once twice a day. Once at 1.30am and once at 1.30pm.
Timed events can be disabled be selecting the "Stop timed events" check box on the HIK API Window.
API Logs
The logs browse displays general information about the API requests, responses and processes.
The log display information about:
Details about a collected event.
The total events collect with each API call.
If the event was processed or rejected. If rejected, it provides a reason.
If the event was added as a clocking to Eco Time.
When manual or timed events were triggered.
FAQ
In which Eco Time version is this feature available?
From version 2023.08.29 onwards.
How can the API Client Request Window be used for fault finding?
This windows displays the request link in the server fields. You can use his value to determine if the correct link is being used durig the rest call.
Consider selecting the "Do Not Process Response" disables any results processing. No tables will be populated. This is typically used for fault finding and is used in cases where you want to inspec the request packet and result packet.
The HIK API Server response is displayed in the response window's text field. This response is the raw unprocessed data from the HIK API Server and represents the true data transmitted and received by the APi Client.
The response packet is JSON and is unformatted (one long string) and is in the body of the response. Copy this body to your clipboard and use an online formatter like https://jsonformatter.org/ to make the response easier to read.
By inspecting the raw formatted JSON response, you can validate the values eventually stored in Eco Time and the HIK API Client.
How do you configure the HIK API Server in HIK Central?
Run the API application by clicking on the Eco HIK API shortcut on the desktop or running the application called EcoHIKAPI32 or EcoHIKAPIMs.
Select the Settings Tab on the Eco Time HIK API Client :
Please note that the "Stop timed events" check box is disabled by default on a new API installation. There is no point running timed events until the configuration and device mapping have been completed.
Select the APi button next to the Version Number field. This will open the API Request Window

Select the Get "Persons List" option by clicking on this item.The persons table contains all the captured employees or visitors on the HIK system
The following persons table fields will be populated
Devices are HIK's main configuration entity. From here doors' (access devices) reader devices are attached. A device can be enabled or disabled. Events from a disabled device, its doors and its readers will be rejected
The doors table contains all the device names where employees or visitors can clock
The following doors table fields will be populated
Note: The HIK devices must be named with the extension Entry or Exit. This will enable the user in EcoTime to configure the corresponding device correctly.
Readers
The readers table contains all the readers names where employees or visitors can clock
The following reader table fields will be populated
From version 2023.08.29 onwards.