Web Api V1.0
Web Api V1.0
User Guide
User Guide
Documentation Disclaimer
Matrix Comsec reserves the right to make changes in the design or components of the product as engineering and
manufacturing may warrant. Specifications are subject to change without notice.
This is a general documentation for all variants of the product. The product may not support all the features and
facilities described in the documentation.
Information in this documentation may change from time to time. Matrix Comsec reserves the right to revise
information in this publication for any reason without prior notice. Matrix Comsec makes no warranties with respect
to this documentation and disclaims any implied warranties. While every precaution has been taken in the
preparation of this system manual, Matrix Comsec assumes no responsibility for errors or omissions. Neither is any
liability assumed for damages resulting from the use of the information contained herein.
Neither Matrix Comsec nor its affiliates shall be liable to the buyer of this product or third parties for damages,
losses, costs or expenses incurred by the buyer or third parties as a result of: accident, misuse or abuse of this
product or unauthorized modifications, repairs or alterations to this product or failure to strictly comply with Matrix
Comsec operating and maintenance instructions.
Copyright
All rights reserved. No part of this system manual may be copied or reproduced in any form or by any means
without the prior written consent of Matrix Comsec.
Version 1.0
Release date: June 2, 2014
Contents
API Overview................................................................................................................................................... 3
How It Works ....................................................................................................................................................... 3
General Features ................................................................................................................................................ 3
What the User Should Know ............................................................................................................................... 4
Prerequisite ......................................................................................................................................................... 4
Enabling API Access ........................................................................................................................................... 4
HTTP Request-Response .................................................................................................................................. 5
Communication Flow ...................................................................................................................................................................... 5
Request Format .............................................................................................................................................................................. 6
Response Format ........................................................................................................................................................................... 7
URL Syntax ..................................................................................................................................................................................... 8
Specifying the Format ..................................................................................................................................................................... 9
Getting a List of Supported Fields ................................................................................................................................................. 10
Additional Information ................................................................................................................................................................... 11
Supported APIs ................................................................................................................................................. 12
Devices .......................................................................................................................................................... 14
Getting a Device List ......................................................................................................................................... 15
Assigning Users to Device ................................................................................................................................ 17
Revoking Users from Device ............................................................................................................................. 19
Adding a New Device ........................................................................................................................................ 21
Deleting a Device .............................................................................................................................................. 24
Obtaining Device Status .................................................................................................................................... 25
Updating Device Configuration ......................................................................................................................... 26
Sites ............................................................................................................................................................... 27
Obtaining Data on Existing Sites ....................................................................................................................... 28
Users ............................................................................................................................................................. 29
Accessing User Data ......................................................................................................................................... 30
Adding/Editing a User ....................................................................................................................................... 34
Adding User Photograph ................................................................................................................................... 42
Deleting a User ................................................................................................................................................. 44
Enrolling a User ................................................................................................................................................. 45
Setting Credentials on Device ........................................................................................................................... 47
Deleting Credentials from Device ...................................................................................................................... 48
Events ............................................................................................................................................................ 84
Adding an Event ................................................................................................................................................ 85
Obtaining Time and Attendance Events ............................................................................................................ 87
Obtaining Time and Attendance Events by Date .............................................................................................. 90
Obtaining Access Control Events ...................................................................................................................... 93
Obtaining Access Control Events by Date ........................................................................................................ 96
Obtaining Door/Alarm/System Events ............................................................................................................... 99
Welcome to the COSEC Web API User Guide. This document will provide you a comprehensive overview and
complete user-guidance for COSEC Web APIs. You can learn more about COSEC Web APIs, browse through
detailed descriptions of individual APIs and test them using sample scenarios.
Document Conventions
This API User Guide will follow a set of document conventions to make it consistent and easier for you to read.
These are as follows:
For e.g. To learn more about APIs, please refer to section API Overview (or, See “API Overview” on
page 3.).
2. The term device used in this document, will refer to all COSEC Panels and COSEC Door Controllers.
4. Text within angle brackets (e.g. “<request-type>”) denotes content in URL syntax and should be replaced
with either a value or a string. The angle brackets should be ommitted in all instances except those used to
denote “tags” within XML responses (e.g. “<name></name>”).
5. Arguments in a request URL, along with their corresponding values, will be separated by a ‘semi-colon’ (‘;’)
from other arguments. “?” will be allowed as a separator between the request-type and an argument.
Special characters (&, ‘, “, <, > and ;) will not be allowed for any arguments and its value.
6. Additional information about any section appears in the form of notices. The following symbols have been
used for notices to draw your attention to important items.
Caution: to indicate an action or condition that is likely to result in malfunction or damage to the
system or your property.
Warning: to indicate a hazard or an action that will cause damage to the system and or cause
bodily harm to the user.
Tip: to indicate a helpful hint giving you an alternative way to operate the system or carry out a
procedure, or use a feature more efficiently.
Document Organization
Chapters 1 and 2 will provide a general understanding of COSEC APIs and the basic interface communication.
Chapters 3 to 13 provide a chapter-wise discussion of API groups with detailed explanation of individual APIs. The
following information has been provided on each request type:
COSEC enables third party developers to access some of its important functionality via APIs. Integrate your
application with COSEC and remotely execute functions such as retrieval of device, user and attendance data,
sending and updating configurations on the COSEC database, applying and approving applications, leave
management, cafeteria management and so on.
How It Works
A COSEC Web API is an interface that interacts with client applications, enabling them to invoke or push data from
and to the COSEC database, using the COSEC Web server. This can be processed by sending a simple HTTP
request to the COSEC server. The server then returns an appropriate response which the remote application can
subsequently process on its own, without the need to launch the COSEC Web application.
Consider an example where an organization (say, ABC) is using COSEC for time and attendance monitoring and
management. However, ABC has its independant Payroll application which requires the input of monthly
attendance data of all employees to process their salaries every month. In such a scenario, the application can be
integrated with COSEC via HTTP to raise a request for the relevant employee records in a specific format.
Thus, COSEC APIs are communicative interfaces that provide effective backend support, making integration
possible from any corner of the world. This also cuts down on an organization’s needs to invest both time and
resources in manual data-handling and data errors, promoting speed, precision and efficiency in resource
management.
General Features
All COSEC APIs -
• Support some predefined parameters and their corresponding values for each action. Each parameter will
either be mandatory or bear a system-defined default value (when no value is specified).
• XML
Prerequisite
In order to use a COSEC API, the user will require:
To learn about system requirements, please refer to the COSEC Manual in your software installation kit.
To know how to enable API access for a user, please refer to the COSEC Manual in your software
installation kit.
Communication Flow
The communication takes place in the following manner:
3. The server parses the request for the action to be taken. For e.g. for the action=get method, the server
fetches specified data from the COSEC database.
4. In case of an error (invalid syntax, invalid authentication etc.), the request is denied and an error response
is returned. Else, the requested data is returned as a response.
3 Empty Line This is an empty line separating headers from the message body.
Example:
Example
When the server gets a request, it will respond with a standard HTTP status code as illustrated in the following
sample response:
HTTP/1.0 200 OK
Date: Sat, 15 Jan 2000 [Link] GMT
Server: Microsoft-IIS/2.0
Content-Type: text/HTML
Content-Length: 1245
Last-Modified: Fri, 14 Jan 2000 [Link]
GMT
HTTP Status Codes: Status codes are 3-digit numeric codes returned in HTTP responses that enable
recipients to understand the successful or failed status of the request issued. In general, codes in the 1xx
range indicate an informational message only, 2xx codes indicate a successful request, 3xx codes indicate
an incomplete request that requires further action, 4xx codes point at client-side errors while 5xx codes
point at server-side errors.
Syntax
[Link]
This describes the server location where the COSEC Web is installed. It could be an IP
address or a domain name.
For eg. let’s say the IP address for COSEC Web is [Link]/cosec. Then a generic
HTTP query would look like:
<servername>
[Link]
Note: This document commonly uses the domain name “matrixserver” for all its
examples.
This specifies the type of API request. For the mandatory request types, please refer to the
<request-type>
individual API descriptions.
These are argument values that determine the response. Requests may allow single or
<value>
multiple (‘comma’ separated) values for an argument, depending on the API called.
Example
Let us assume that the COSEC Web has been installed on a location named “matrixserver”. The user wants to
retrieve a list of all panel devices defined on the COSEC database. In this case, a sample request would resemble
the following:
Sample Request:
[Link]
Sample Response:
id|name|siteid
p_1|Panel-1|
<EOT>
• Text
• XML
The expected response format can be specified using a common argument: format. When no format is specified,
the response is returned in text format, by default.
Example
Sample Request:
[Link]
Sample Response:
id|name|siteid
d_1|direct door|1
d_3|NGT Door|1
d_6|5453|1
d_2|NGTDoor1|1
<EOT>
Sample Request:
[Link]
Syntax
[Link]
The valid arguments for this request are action and format.
Example
Sample Request:
[Link]
Additional Information
1. If an argument-value pair is mentioned multiple times in a request, the last value will be considered.
Example:
[Link]
2. For all the API’s the response for date parameters will be in the following format: mm/dd/yyyy HH:MM
3. Special characters (&, ‘, “, <, > and ;) for any arguments and its value are not allowed.
COSEC APIs use basic authentication and can be tested on any standard Web browser. Enter the request
URL in the address field of your browser and press the ‘Enter’ key to send query to the server. Enter the
authentication credentials when prompted. The response will be displayed on your browser in the specified
format.
[Link]
Getting a Device List device? Basic
device?action=get;<argument>=<value>...
[Link]
Assigning Users to Devices device? Basic
device?action=assign;<argument>=<value>...
[Link]
Revoking Users from Device device? Basic
device?action=revoke;<argument>=<value>...
[Link]
Adding a New Device device? Basic
device?action=set;<argument>=<value>...
[Link]
Deleting a Device device? Basic
device?action=delete;<argument>=<value>...
[Link]
Obtaining Device Status device? Basic
device?action=list;<argument>=<value>......
[Link]
Updating Device
device? device?action=update;<argument>=<value>... Basic
Configuration
..
[Link]
Accessing User Data user? Basic
user?action=get;<argument>=<value>...
[Link]
Adding/Editing a User user? Basic
user?action=set;<argument>=<value>...
[Link]
Adding User Photograph user? Basic
user?action=setphoto;<argument>=<value>...
[Link]
Deleting a User user? Basic
user?action=delete;<argument>=<value>...
[Link]
Enrolling a User user? Basic
user?action=enroll;<argument>=<value>...
organization?,
branch?,
Obtaining Enterprise Group department?, [Link]
T&A or Roster
Details designation?, group>?action=get;<argument>=<value>...
category?, grade?,
section?
[Link]
Obtaining List of Access
accessroutemaster? accessroutemaster?action=get;<argument>=< Access Control
Routes
value>...
[Link]
Obtaining Access Route Access Control
accessroutedetails? accessroutedetails?action=get;<argument>=<
Details
value>...
[Link]
Getting Export Template List template-list? Basic
list?action=get;<argument>=<value>...
[Link]
Getting Import Template List import-template-list? Basic
list?action=get;<argument>=<value>...
[Link]
Getting Template Data template-data? Basic
data?action=get;<argument>=<value>...
[Link]
Retrieving User Data datatransfer? datatransfer?action=get;<argument>=<value>. Basic
.
[Link]
Sending User Data datatransfer? datatransfer?action=set;<argument>=<value>. Basic
.
[Link]
Adding an Event events? Basic
events?action=set;<argument>=<value>...
[Link]
Sending Commands to commands?action=command;<argument>=<v
device-commands? Basic
Device alue>......
[Link]
Getting User Count on
device-users? users?action=get;<argument>=<value>...... Basic
Devices
The Devices interface lets you access and modify device data on the COSEC server. The HTTP query syntax to
access device data from the COSEC server is as follows:
Syntax
[Link]
• Deleting a Device
This COSEC API allows the user to obtain a list of available devices on the COSEC database. For instance, an
organization may have 100 panels and 200 direct door devices enlisted via COSEC. The user can obtain a list of all
the 300 devices or a list for an individual device type using this command.
Action
action=get
Syntax
[Link]
Parameters
Response Fields
Example
This example presents a sample request and response case when accessing “matrixserver”, for obtaining a list of
all available devices:
Sample Request:
[Link]
id|name|siteid
g_1|Device-1|
g_2|dnext|
g_3|d3|
g_4|Research|
p_1|Panel-1|
d_1|direct door|1
d_3|NGT Door|1
d_6|5453|1
d_2|NGTDoor1|1
<EOT>
The sample response simply illustrates a particular instance of the expected output. The actual data for
each field will differ from case to case.
Sample Request:
For type=door,
[Link]
Sample Response:
id|name|siteid
d_1|direct door|1
d_3|NGT Door|1
d_6|5453|1
d_2|NGTDoor1|1
<EOT>
This function helps assign a user to all or specific Panels, Direct Doors or Device Groups pre-defined on the
COSEC system.
Action
action=assign
Syntax
[Link]
Parameters
Multiple devices (either panels or doors) of the same type can be specified, each value separated by a ‘comma’
(For eg. device=p_1,p_2,p_3,p_4,d_1,d_2,d_3,d_4,…). User can also define a range of devices (eg.
device=p_1-p_50). However, only a single group can be assigned to a user. The same should also be applicable
for id values.
Example
Sample Request:
[Link]
Sample Response:
[Link]
Sample Response:
success: successful
Sample Request:
[Link]
Sample Response:
success: successful
Sample Request:
[Link]
Sample Response:
success: successful
The purpose of this function is to revoke a user from all or specific devices defined on the COSEC system. This can
be performed for a single device type, multiple device types or for a specific device group.
Action
action=revoke
Syntax
[Link]
Parameters
Example
This example presents a sample request and response when accessing “matrixserver”.
Sample Request:
[Link]
Sample Response:
success: successful
Sample Request:
[Link]
Sample Response:
success: successful
Sample Request:
For “device=p_1,d_1,g_1”.
[Link]
success: successful
This function enables you to define a new biometric device on the COSEC database and set certain configurations
depending on the device type. The device can be assigned to a specified device group and site and configured
based on site requirements.
Action
action=set
Syntax
[Link]
Parameters
Here,
0 = Panel,
1 = Direct Door V1,
device-type 0,1,2,3,4,5,6,7,8,9 Yes - 2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
5 = Wireless Direct Door
6 = Path Controller
7 = PVR Direct Door
8 = Vega Panel-Lite
9 = Vega Controller
0= none
1= emprox reader
2= hidprox reader This is the internal card reader
card-reader-type No 1 (emprox reader)
3= mifare reader type.
4= hid iclass u-reader
5= hid iclass w-reader
0= entry
er-mode No 1 (exit) This is the external reader mode.
1= exit
To update device configurations for the above parameters, See “Updating Device Configuration” on
page 26.
The following is an example of a successful request sent to “matrixserver” with the following values:
• device-type=0
• device-id=1
• name=panel
• mac=[Link]
• device-group=Research
Sample Request:
[Link]
id=1;name=panel;mac=[Link];device-group=Research
Sample Response:
success: successful
This Devices function allows you to delete a biometric device from the COSEC database. Specify the device type
and device ID to send a ‘delete’ command.
Action
action=delete
Syntax
[Link]
Parameters
Here,
0 = Panel,
1 = Direct Door V1,
device-type 0,1,2,3,4,5,6,7,8,9 Yes - 2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
5 = Wireless Direct Door
6 = Path Controller
7 = PVR Direct Door
8 = Vega Panel-Lite
9 = Vega Controller
Example
The following example illustrates how to delete a direct door device with a device identification number 1:
Sample Request:
[Link]
Sample Response:
success: successful
This function enables the user to obtain the connection status of devices. The user can obtain a list of devices from
the COSEC server based on the device status. The device status can be either ‘connected’ or ‘disconnected’.
Action
action=list
Syntax
[Link]
Parameters
Example
Sample Request:
[Link]
Sample Response:
Sample Request:
When “status=all”,
[Link]
Sample Response:
device-type|device-id|name|active|ip|mac|status|connect-time|disconnect-time
0|1|Panel-1|1||[Link]|disconnected||10/3/2013 [Link] AM
1|1|door|1|[Link]|[Link]|disconnected|10/3/2011 [Link] AM|10/3/2013 [Link] AM
4|2|NGTDoor1|1||[Link]|disconnected||10/3/2013 [Link] AM
3|3|NGT Door|1||[Link]|disconnected||10/3/2013 [Link] AM
3|6|5453|1||[Link]|disconnected||10/3/2013 [Link] AM
<EOT>
Specify a device ID and device type and edit the configuration for this device as saved on the COSEC database.
Parameters that can be updated are specified in the argument-value table below.
Action
action=update
Syntax
[Link]
Parameters
The Login User must have rights on the device which is to be updated.
Example
Sample Request:
[Link]
Sample Response:
success: successful
Sample Request:
When the specified MAC address is already associated with another device. Failed Request.
[Link]
type=9;mac=[Link];device-group=RnD
Sample Response:
A Site is a work area or unit defined on the COSEC system to which one or more COSEC devices are assigned. A
site can be defined by an administrator based on requirements. For e.g.: The organization ABC could have multiple
sites defined, such as ABCheadoffice, ABCfactory, ABCwarehouse and so on. This COSEC API allows users to
access data of specific sites using COSEC. The http query to access site data from the COSEC server should
resemble the following syntax:
Syntax
[Link]
This function allows the user to access data about existing sites. This includes the Site ID, Site Name and a Default
site.
Action
action=get
Syntax
[Link]
Response Fields
Example
Sample Request:
[Link]
Sample Response:
Id|Name|Default
1|Site-1|1
2|h|0
<EOT>
Sample Request:
[Link]
Sample Response:
This API allows the access and modification of user data from the COSEC database. The Users APIs allows you to
perform the following functions:
• Adding/Editing a User
• Deleting a User
• Enrolling a User
This function allows you to retrieve specific data for a single user or multiple users. For instance, this method can
be used to retrieve an employee’s name, date-of-birth, joining date, blood-group, Passport Number etc.
Action
action=get
Syntax
[Link]
Parameters
Response Fields
Allowed Characters
A-Z
Id id max 10 characters a-z
0-9
/_\\.@:
Allowed Characters
A-Z
User Name name max 45 alphanumeric characters a-z
0-9
-_. ()[]
1 : Active
Active active -
0 : Inactive
U- T&A User
Module module -
R- Roster User
na
Gender gender male -
female
na,a+,a-,b+,b-,ab+,ab-,o+,o-
Blood Group blood-group ,A1–,A1+,A1B-,A1B+,A2- -
,A2+,A2B–,A2B+,B1+
married
Marital Status marital-status unmarried -
na
1 : enabled
ESS Login ess-login -
0 : disabled
1 : editing allowed
ESS Detail Edit ess-detail-edit -
0 : editing not allowed
1 : enabled
Attendance via ESS attendance-via-ess -
0 : disabled
1 : enabled
Active Directory Login active-directory-login -
0 : disabled
1 : enabled
Attendance Calculation attendance-calc -
0 : disabled
1 – enable bypass
Bypass Fingerprint/Palm bypass-finpalm -
0 – disable bypass
1 – enable bypass
Bypass Finger bypass-finger -
0 – disable bypass
1 – enable bypass
Bypass Palm bypass-palm -
0 – disable bypass
1 – access allowed
Shift based access shiftbased-access -
0 – access denied
1 - allowed
Allow e-Canteen allow-ecanteen -
0 – not allowed
1 - postpaid
Account Type account-type -
0 - prepaid
This API will allow you to define a new user, as well as add/edit specific data for an existing user on the COSEC
database (only single user at a time). For instance, this process can be used to add information such as an
employee’s name, date-of-birth, joining date, blood-group, Passport Number etc.
Action
action=set
If the action=set request is sent for an existing user, the new values sent will overwrite the existing values,
if any.
Syntax
[Link]
Parameters
Y (if
This is the joining date of the user.
confirmation-
joining-date ddmmyyyy format
date or leaving- -
Note: - joining-date should be higher
date to be
than date-of-birth.
configured)
Max 30 Alphanumeric
pf-no No - This is the PF Number of the user.
Characters
Max 30 Alphanumeric
driving-license No - This is the driving license of the user.
Characters
Max 30 Alphanumeric
pan No - This is the PAN of the user.
Characters
Max 30 Alphanumeric
esi-no No - This is the ESI Number of the
Characters
na,
gender No NA This is the gender of the user.
male,female
NA,A+,A-,B+,B-
,AB+,AB-,o+,o-
blood-group ,A1–,A1+, A1B-, No NA This is the blood group of the user.
A1B+,A2-
,A2+,A2B–,A2B+,B1+
Max 20 alphanumeric
nationality No - This is the nationality of the user.
characters
Max 50 Alphanumeric
qualification No - This is the qualification of the user.
Characters
max 50 alphanumeric
experience No - This is the work experience of the user.
characters
max 50 alphanumeric
medical-history No - This is the medical history of the user.
characters
max 30 alphanumeric
local-address1 No - This is the local address 1 of the user.
characters
max 30 alphanumeric
local-address2 No - This is the local address 2 of the user.
characters
max 30 alphanumeric
local-street No - This is the street for local address 1.
characters
max 40 alphanumeric
local-city No - This is the city for local address 1.
characters
max 40 alphanumeric
local-state No - This is the state for local address 1.
characters
max 20 alphanumeric
local-country No - This is the country for local address 1.
characters
max 30 alphanumeric
permanent-city No - This is the city for permanent address 1.
characters
max 100
This is the personal email address of
personal-email alphanumeric No -
the user.
characters
max 10 numeric
official-extension No - This is the extension of the user.
characters
max 100
This is the official email address of the
official-email alphanumeric No -
user.
characters
Default
organization
organization 1 to 999999 No defined in This is the ‘Organization’ of the user.
Enterprise
structure
Default branch
defined in
branch 1 to 999999 No This is the ‘Branch’ of the user.
Enterprise
structure
Default department
defined in
department 1 to 999999 No This is the ‘Department’ of the user.
Enterprise
structure
Default section
defined in
section 1 to 999999 No This is the ‘Section’ of the user.
Enterprise
structure
Default category
defined in
category 1 to 999999 No This is the ‘Category’ of the user.
Enterprise
structure
Default grade
defined in
grade 1 to 999999 No This is the ‘Grade’ of the user.
Enterprise
structure
Default designation
defined in
designation 1 to 999 No This is the ‘Designation’ of the user.
Enterprise
structure
Default
max 4 alphanumeric Employment This is the roster user’s Employment
employment-profile No
characters contract defined in contract.
Roster
Default
max 4 alphanumeric This is the roster user’s Employment
employment-type No Employment type
characters type.
defined in Roster
Default Work
max 4 alphanumeric This is the work profile assigned to the
work-profile No Profile defined in
characters roster user.
Roster
Default General
max 4 alphanumeric Rules defined in This is the general rules assigned to the
general-rules No
characters Roster roster user.
Default Policy
max 4 alphanumeric This is the policy assigned to the roster
policy No defined in Roster
characters user.
Default Attendance
Policy defined in
This is the ‘Attendance policy’ of the
attendance-policy 1 to 99 No Time &
user.
Attendance/
Policies
Default Late In
Policy defined in
lateIn-policy 1 to 99 No Time & This is the ‘Late-In policy’ of the user.
Attendance/
Policies
Default Overtime
Policy defined in
overtime-policy 1 to 99 No Time & This is the ‘Overtime policy’ of the user.
Attendance/
Policies
Default Absentee
Policy defined in
absentee-policy 1 to 99 No Time & This is the ‘Absentee policy’ of the user.
Attendance/
Policies
Default COFF
Policy defined in
coff-policy 1 to 99 No Time & This is the ‘COFF policy’ of the user.
Attendance/
Policies
max 2 alphanumeric The selected The user should define the start shift for
start-shift No
characters schedule’s first shift the selected shift schedule.
max 30 numeric
device-group No - This is the name of the device group.
characters
As specified in
This defines the max allowed limit for
max-allowed-limit 0.0 to 9999999.9 No eCanteen/Account
the canteen user for a month.
configuration
Example
The following examples illustrate sample requests for adding or editing users.
Sample Request:
To add a user named “Sam”, whose user ID is “202” (activated for the Time and Attendance module license) -
[Link]
Sample Response:
success: successful
Sample Request:
To add details such as date of birth, gender, nationality and blood group for the user Sam.
[Link]
birth=22061978;gender=male;nationality=indian;blood-group=b+
Sample Response:
success: successful
Sample Request:
[Link] Jackson
Sample Response:
success: successful
Update the user photograph in a user’s configured profile on COSEC using this request.
Action
action=setphoto
Syntax
[Link]
Parameters
Max 10 alphanumeric
userid Yes - This is the unique User Id.
characters
Example
This sample request illustrates how to set a photograph for the user ID 202, when the source image file [Link]
is located in the following FTP location: [Link]
Sample Request:
[Link]
[Link];ftpusername=sam;ftppassword=1234
success: successful
This function can be used to delete an existing user from the COSEC database permanently. Only a single user can
be deleted at a time using this method.
Action
action=delete
Syntax
[Link]
Parameters
Example
This example illustrates how to delete the user Samuel (id=202) from the COSEC database:
Sample Request:
[Link]
Sample Response:
success: successful
This API can be used to generate an enrollment request for a user on a specific device. Only a single user can be
enrolled at a time using this action.
Action
action=enroll
Syntax
[Link]
Parameters
Max 10 alphanumeric
id Yes - This is the unique User ID.
characters
Yes. Only if
device type =
This is the Panel Door identification
Panel (0),
panel-door-id 1 to 99 - number, in case a panel is selected for
Panel-Lite
device-type.
(2), or Vega
Panel-Lite (8)
1 to 10 (for enroll-
type=fp)
This is the count for the enroll type
1,2 (for enroll-
enroll-count Yes - (finger print, card or palm) to be
type=card)
enrolled for the respective user id.
1 to 10 (for enroll-
type=palm)
This example demonstrates a typical request URL for enrolling 2 fingers for a user on a Direct Door V1:
Sample Request:
[Link]
Sample Response:
success: successful
Send a user’s credentials to all the available panel or direct door devices on COSEC. There are two types of
credentials that can be set for a user - fingerprint (fp) and card.
Action
action=set-credential
Syntax
[Link]
Parameters
Max 10 alphanumeric
id Yes - This is the unique User Id.
characters
Example
The following example illustrates how to add user credentials with the given set of values:
• id=1
• credential-type=card
• data=12345678901234567890 (card number)
Sample request:
[Link]
type=card;data=12345678901234567890
Sample Response:
success: successful
Delete a user’s credentials from all the available panel or direct door devices on COSEC.
Action
action=del-credential
Syntax
[Link]
Parameters
Max 10 alphanumeric
Id Yes - This is the unique User Id.
characters
Example
This example demonstrates a sample request to delete fingerprint credentials for a user with user ID “1” from all
devices on the COSEC database.
Sample Request:
[Link]
Sample Response:
success: successful
The Enterprise Structure APIs allow the user to retrieve data related to various groups within an enterprise. COSEC
identifies the following enterprise groups:
• Organization
• Branch
• Department
• Designation
• Section
• Category
• Grade
The generic syntax for all Enterprise Structure API requests is stated below.
Syntax
[Link]
Here, the request-type (<enterprise-group>) will depend on the enterprise group for which the API is being called.
For e.g.:
[Link]
[Link]
[Link]
For each of the Enterprise Groups, COSEC supports the following APIs:
User can fetch the details of an enterprise group by specifying the group name in the <enterprise-group> part of the
URL and specifying the group ID. For example, for an organization, the group ID will be the Organization ID.
Action
action=get
Syntax
[Link]
Parameters
1-999999
This is the ID of the specific enterprise
Note: This is the
group.
minimum to maximum
id No All Multiple IDs can be selected, each
range. In case of a
separated by “, (comma)” e.g.:”1, 3, 7,
system with a defined
9…”
ID range 1-50, valid
range shall be 1-50.
Response Fields
ID id 1-999999 -
Allowed Characters
upto 40 characters (for
A-Z
“Organization” and “Branch”)
Name name a-z
0-9
upto 30 characters (for others)
-_. ()[]
Example
Sample Request:
[Link]
Sample Response:
id|name
7|Apex Industries Pvt. Ltd.
<EOT>
On COSEC, it is possible for an administrator to rename enterprise groups (For eg. “Organization” can be renamed
as “Organization1”). This particular API allows the user to retrieve the data of all enterprise groups which have been
renamed and their relevant details such as the group code, the display name and the alias name.
Action
action=get
Syntax
[Link]
Response Fields
Allowed characters:
A-Z
Name displayName maximum 30 characters a-z
0-9
-_.()[]
Allowed characters:
A-Z
Alias Name aliasName maximum 30 characters a-z
0-9
-_.()[]
This API will return only values that are in the English Language. In case the groups are renamed and
stored in a different language, the original English group name will be used.
Example
Sample Request:
[Link]
Sample Response:
code|displayName|aliasName
Org|Organization|Organization
Brc|Branch|Branch
Dpt|Department|Department
Sec|Section|Section
Ctg|Category|Category
Grd|Grade|Grade
Dsg|Designation|Designation
Usr|User|User
<EOT>
This section covers all APIs pertaining to Time and Attendance data of COSEC users. These are as follows:
This API allows the user to obtain daily attendance data for employees over a specified time duration and for
specific user groups.
Action
action=get
Syntax
[Link]
Parameters
all
organization
branch
department
Range of users for whom data is to be
range designation No All
fetched.
section
category
grade
user
Response Fields
M : Male
Gender GENDER F: Female -
NA : Not available
M : Married
Marital Status MRTLSTAT U : Unmarried -
NA : Not available
1=Official In,
2=Official Out,
3=ShortLeave In,
4=ShortLeave Out,
5=Regular In,
Special Function 1 SPFID1 1-10
6=Regular Out,
7=Lunch In,
8=Lunch Out,
9=Overtime In,
10=Overtime Out
PR : Present
AB : Absent
WO : Week Off
PH : Public Holiday <Leave Codes> as
First Half FIRSTHALF
FB : Field Break configured in COSEC
RD : Rest Day
IN : Official In
<Leave Codes>
PR : Present
AB : Absent
WO : Week Off
PH : Public Holiday <Leave Codes> as
Second Half SECONDHALF
FB : Field Break configured in COSEC
RD : Rest Day
IN : Official In
<Leave Codes>
MANUALOVERTIME_CREDIT
Manual OT Credit HH:MM -
_HHMM
MANUALOVERTIME_DEBIT_
Manual OT Debit HH:MM -
HHMM
AUTHORIZEDOVERTIME_H
Authorized OT HH:MM -
HMM
OVERTIMEAUTHORIZATION
OT Authorization Date dd/mm/yyyy -
DATE
MANUALCOFF_CREDIT_HH
Manual C-Off Credit HH:MM -
MM
MANUALCOFF_DEBIT_HHM
Manual C-Off Debit HH:MM -
M
0 : Normal
Shift Type SHIFTTYPE 0,1,2 1 : Field Break
2 : Rest Day
0 : WO
1 : PH
Day Status DAYSTATUS -
2 : WO/PH
3 : Normal
Return If [Link]
In/Out Reason for Punch 1 punch_reason1 30 alphanumeric characters
blank.
Example
Sample Request:
[Link]
UserID|UserName|ProcessDate|Punch1|Punch2|WorkingShift|LateIn|EarlyOut|Overtime|WorkTime
1|SALIM ANSARI|01/01/2013|||23|0|0|0|0
10|RAJENDRA GOSWAMI|01/01/2013|||23|0|0|0|0
1001|ANKITKUMAR SOHLIYA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|582
1002|MEGHA H SHUKLA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|582
1003|UMESH M TALANPURI|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|539
1004|DARSHAK B PATEL|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|541
1007|DHAVAL I PATEL|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|605
1008|MAYANK K KORAT|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|564
1009|DIPTI K RATHWA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|544
1010|RAHUL S SHAH|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|576
1011|PARIKA S PANDEY|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|528
1012|PARIKSHIT DAS|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|602
1015|SUMEDHA A GAWARIKAR|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|533
1016|BALAJI A|01/01/2013|||GN|0|0|0|0
102|AKSHAY SHETH|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|531
1020|VAISHALI M THAKER|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|474
1022|PANDURANG D CHAUHAN|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|555
1028|SUNIL K GURNANI|01/01/2013|||GN|0|0|0|0
1030|KEYUR BHALODIYA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|697
1038|TANMAY SHAH|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|532
<EOT>
Sample Request:
[Link]
Sample Response:
UserID|UserName|ProcessDate|Punch1|Punch2|WorkingShift|LateIn|EarlyOut|Overtime|WorkTime
1|SALIM ANSARI|01/01/2013|||23|0|0|0|0
10|RAJENDRA GOSWAMI|01/01/2013|||23|0|0|0|0
1001|ANKITKUMAR SOHLIYA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|582
1002|MEGHA H SHUKLA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|582
1003|UMESH M TALANPURI|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|539
1004|DARSHAK B PATEL|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|541
1007|DHAVAL I PATEL|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|605
1008|MAYANK K KORAT|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|564
1009|DIPTI K RATHWA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|544
1010|RAHUL S SHAH|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|576
1011|PARIKA S PANDEY|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|528
1012|PARIKSHIT DAS|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|602
1015|SUMEDHA A GAWARIKAR|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|533
1016|BALAJI A|01/01/2013|||GN|0|0|0|0
102|AKSHAY SHETH|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|531
1020|VAISHALI M THAKER|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|474
1022|PANDURANG D CHAUHAN|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|555
1028|SUNIL K GURNANI|01/01/2013|||GN|0|0|0|0
1030|KEYUR BHALODIYA|01/01/2013|01/01/2013 [Link]|01/01/2013 [Link]|GS|0|0|0|697
<EOT>
Sample Request:
[Link]
range=01012013-02012013
UserID|firsthalf|secondhalf
1|WO|WO
10|WO|WO
1001|AB|AB
1002|AB|AB
1003|AB|PR
1004|AB|AB
1007|AB|AB
1008|AB|AB
1009|AB|AB
1010|AB|AB
1011|AB|AB
1012|AB|AB
1015|AB|AB
1016|PR|PR
102|AB|AB
1020|AB|AB
1022|AB|AB
1028|PR|PR
1030|AB|AB
<EOT>
This API allows the user to obtain attendance data for employees for a specific month and for specific user groups
in a specific format.
Action
action=get
Syntax
[Link]
Parameters
the format shall be Current Month and The Month and Year for which the data
month-year No
mmyyyy Current Year is to be fetched.
all
organization
branch
Range of users for whom data is to be
department
fetched.
range designation No All
section
category
grade
user
M : Male
Gender GENDER F: Female -
NA : Not available
M : Married
Marital Status MRTLSTAT U : Unmarried -
NA : Not available
Example
This example presents a case where monthly-attendance records are to be fetched for Organization ID ‘1’.
Sample Request:
http:/matrixserver/[Link]/attendance-monthly?action=get;range=organization;id=1
Sample Response:
UserID|UserName|PYear|PMonth|PRDays|ABDays|WorkTime_HHMM|PLDays|TRDays
1053|JINU SAM|2013|1|21.0|0.5|15:20|2.5|0.0
1054|PARSHV SHAH|2013|1|24.0|0.0|21:13|0.0|0.0
1055|SANDIP PATEL|2013|1|15.0|6.5|56:56|2.5|0.0
1056|RITESH RAJPUT|2013|1|19.5|4.5|77:07|0.0|0.0
1057|JANPRIYA MALVIYA|2013|1|23.0|1.0|35:36|0.0|0.0
1059|PRATIK PATEL|2013|1|17.5|6.5|70:02|0.0|0.0
1060|PRIYESH SHAH|2013|1|23.5|0.0|17:13|0.5|0.0
1061|DARSHAN PATEL|2013|1|24.0|0.0|17:46|0.0|0.0
1062|MANTHAN PATEL|2013|1|23.0|0.0|13:27|1.0|0.0
895|Atul Kumar Gond|2013|1|5.0|19.0|02:41|0.0|0.0
900|Shaun Trivedi|2013|1|0.0|25.0|00:00|0.0|0.0
<EOT>
The Access Control APIs primarily support the retrieval of access route data, as configured on the COSEC server.
An Access Route on COSEC is a configured sequence in which a user is allowed access on Doors assigned to a
particular Panel device, or based on the access policy defined on a Smart Card. Access Routes can be of two types
- Panel-based access routes and Smart Card-based access routes.
The Access Control APIs enable the user to perform the following functions:
This API allows the user to fetch a list of all existing access routes configured on COSEC and the respective
number of group members assigned to each route.
Action
action=get
Syntax
[Link]
Parameters
type smartcard, panel No smartcard This is the type of the access route.
Response Fields
1. For type=smartcard
1 : active
Active Active -
0 : inactive
1 : reset enabled
Reset On Lowest Level ResetOnLowestLevel -
0 : reset disabled
Count of configured
Group Members GroupMembers 0 - 75
members
2. For type=panel
1 : active
Active Active -
0 : inactive
1
Sequence Sequence -
0
1 : reset enabled
Reset On Lowest Level ResetOnLowestLevel -
0 : reset disabled
Count of configured
Group Members GroupMembers 0 - 32
members
Example
Sample Request:
[Link]
Sample Response:
AccessRouteNumber|AccessRouteName|HardSoft|Active|ResetOnLowestLevel|GroupMembers
1|factory|Soft|1|0|1
2|Factory|Soft|1|0|2
3|Randd|Soft|1|0|2
<EOT>
This API allows the user to request details of all or specific access routes configured on COSEC.
Action
action=get
Syntax
[Link]
Parameters
type smartcard, panel No smartcard This is the type of the access route.
Response Fields
1. For type=smartcard
DID DID 1 - 75 -
Level Level 1 - 75 -
2. For type=panel
Level Level 1 - 32 -
Example
Sample Request:
[Link]
Sample Response:
ARID|MID|DID|DoorType|DoorName|Level
1|17|1|Direct Door v2||0
1|48|1|Direct Door v2||0
<EOT>
The Data Templates API allows users to define a sequence in which certain specified data fields can be imported/
exported from or to external modules, such as Payroll. This chapter lists COSEC APIs that allow users to retrieve
specific import/export template-related data. These are as follows.
COSEC helps users to create data templates that can carry certain data specified by the user. Using this API, a
user can obtain a list of all existing export templates configured on COSEC along with their IDs, names and types.
Action
action=get
Syntax
[Link]
Parameters
Response Fields
Template ID id 1-999 -
1: daily
2: monthly
Template-Type template-type -
3: event-ta
4: event-acs
Example
The following examples illustrate how template list is fetched with different template-type values:
Sample Request:
[Link]
id|name
1|Daily Attendance Detail
2|Monthly Attendance Summary
3|Attendance Events
4|Access Control Events
101|Monthly Attendance Summary
102|Daily Attendance Detail
<EOT>
Sample Request:
[Link]
Sample Response:
id|name|template-type|view-id
1|API_Template_Daily|1|9
2|API_Template_Monthly|2|8
3|API_Template_ATDEvents|3|7
4|API_Template_ACSEvents|4|6
101|MONTH ATTENDANCE|2|1
102|daily|1|2
<EOT>
This API allows the user to obtain the details such as fields, their type, length, name etc. for all or specified export
templates on the COSEC database.
Action
action=get
Syntax
[Link]
Parameters
Response Fields
The response will contain a list of fields defined for the specified templates. For each field the following will be
provided:
0 : database field
Field type field-type 0, 1, 2 1: static field
2: custom field
0: not mandatory
Mandatory mandatory 0, 1
1: mandatory field
This API can be used to fetch a list of all templates configured on the COSEC Web Application for user data import
and event import (both Access Control and Attendance events table).
Action
action=get
Syntax
[Link]
Response Fields
As configured in COSEC
Template Id TemplateId numeric
Web Application.
As configured in COSEC
Code code alpha-numeric
Web Application.
Example
Sample Request:
[Link]
Sample Response:
TemplateID|Code
1|USER
2|EVENT
<EOT>
This API enables the user to fetch the internal table structure for the user master table and events table (both
Access Control and Time and Attendance events table), indicating the fields, its data type and field length.
Action
action=get
Syntax
[Link]
Parameters
1 to 2
1=user template
id No all This is the template id.
schema
2=event template
schema
Response Fields
This is a common API that can be used to retrieve the data for a specified template.
Action
action=get
Syntax
[Link]
Parameters
1- 99 : API Templates
id 1-999 Yes -
101-999 : Custom Templates
category
Note: These parameters should not be
grade mentioned if userid is mentioned.
Response Fields
Allowed characters
A-Z
User ID user-id upto 10 characters a-z
0-9
/_\\.@:
Allowed Characters
A-Z
User Name user-name upto 45 characters a-z
0-9
-_. ()[]
Example
Sample Request:
[Link]
TEMPLATE-ID|USERID|USERNAME|UserID1|UserName1|ProcessDate|Punch1|Punch2|WorkingShift|LateIn|EarlyOut|Overtime|WorkTime
1|1|SALIM ANSARI|1|SALIM ANSARI|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|23|0|0|0|534
1|10|RAJENDRA GOSWAMI|10|RAJENDRA GOSWAMI|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|23|0|0|0|492
1|1001|ANKITKUMAR SOHLIYA|1001|ANKITKUMAR SOHLIYA|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|529
1|1002|MEGHA H SHUKLA|1002|MEGHA H SHUKLA|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|327
1|1003|UMESH M TALANPURI|1003|UMESH M TALANPURI|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|524
1|1004|DARSHAK B PATEL|1004|DARSHAK B PATEL|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|549
1|1007|DHAVAL I PATEL|1007|DHAVAL I PATEL|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|612
1|1008|MAYANK K KORAT|1008|MAYANK K KORAT|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|635
1|1009|DIPTI K RATHWA|1009|DIPTI K RATHWA|11/02/2013|||GS|0|0|0|0
1|1010|RAHUL S SHAH|1010|RAHUL S SHAH|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|556
1|1011|PARIKA S PANDEY|1011|PARIKA S PANDEY|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|530
1|1012|PARIKSHIT DAS|1012|PARIKSHIT DAS|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|609
1|1015|SUMEDHA A GAWARIKAR|1015|SUMEDHA A GAWARIKAR|11/02/2013|11/02/2013 [Link]|11/02/2013 [Link]|GS|0|0|0|561
1|1016|BALAJI A|1016|BALAJI A|11/02/2013|||GN|0|0|0|0
1|1|SALIM ANSARI|1|SALIM ANSARI|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|23|0|0|0|476
1|10|RAJENDRA GOSWAMI|10|RAJENDRA GOSWAMI|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|23|0|0|0|495
1|1001|ANKITKUMAR SOHLIYA|1001|ANKITKUMAR SOHLIYA|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|548
1|1002|MEGHA H SHUKLA|1002|MEGHA H SHUKLA|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|563
1|1003|UMESH M TALANPURI|1003|UMESH M TALANPURI|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|530
1|1004|DARSHAK B PATEL|1004|DARSHAK B PATEL|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|553
1|1007|DHAVAL I PATEL|1007|DHAVAL I PATEL|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|601
1|1008|MAYANK K KORAT|1008|MAYANK K KORAT|12/02/2013|||GS|0|0|0|0
1|1009|DIPTI K RATHWA|1009|DIPTI K RATHWA|12/02/2013|||GS|0|0|0|0
1|1010|RAHUL S SHAH|1010|RAHUL S SHAH|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|561
1|1011|PARIKA S PANDEY|1011|PARIKA S PANDEY|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|538
1|1012|PARIKSHIT DAS|1012|PARIKSHIT DAS|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|531
1|1015|SUMEDHA A GAWARIKAR|1015|SUMEDHA A GAWARIKAR|12/02/2013|12/02/2013 [Link]|12/02/2013 [Link]|GS|0|0|0|544
1|1016|BALAJI A|1016|BALAJI A|12/02/2013|||GN|0|0|0|0
<EOT>
The Data Transfer API enables the COSEC system to send a user’s image/finger print template/palm template to a
third party application. It also enables the system to receive the image/finger print template/palm template for a user
and save/update it in the COSEC database.
Only a single user’s data can be sent in one request. Also, only one image/template can be transferred at a time.
The supported size limit for data transfer are as follows –
• Image – 250 kb
• FP template – 768 bytes
• Palm template – 3 kb
Syntax
[Link]
This functionality enables the third party to fetch user image/finger print template/palm templates from the COSEC
database.
Action
action=get
Syntax
[Link]
Parameters
The image/template shall be sent in API data and not in API arguments.
This API can be used by a third party application to send a user’s data to the COSEC database. This user data is
subsequently saved or updated in the database.
Action
action=set
Syntax
[Link]
Parameters
0-9 : if it is a palm By default, the The position where the template should
template. template will be stored be stored.
location No
0-9 : if it is a finger print at the first available
template. (empty) location for the Valid only for FP and Palm templates.
user.
• Adding an Event
This API allows the user to add an event into COSEC for processing. This can include both time and attendance, as
well as access control events.
Action
action=set
Syntax
[Link]
Parameters
1 to 65000 (panel,
panel-lite) This specifies the device MID as set in
mid No 0
1 to 65000 (direct cosec.
doors)
0 = Panel
1 = Direct Door V1
2 = Panel Lite
dtype Numeric (1,0) No 0 3 = Direct Door V2
4 = NGT Direct Door
5 = Wireless Direct Door
6 = Path Controller
7 = PVR Direct Door
8= Vega Panel-Lite
9= Vega Controller
None = 0,
PIN = 1,
Card = 2,
Card_PIN = 3,
FingerPrint = 4,
Finger_PIN = 5,
This will specify the credentials used
credentials Finger_Card = 6, No 0
for the event.
Finger_Card_PIN = 7,
Palm = 8,
Palm_PIN = 9,
Palm_Card = 10,
Palm_Card_PIN = 11,
Palm_Group = 24
0=Device
This will indicate the event source to
1=USB
the COSEC software.
2=ESS
event_src 3=SMS No 5 (Others)
Note : Specify event_src=6 when
4=PIM
Events are submitted using a Mobile
5=Others
Application.
6=APP
When event_src= 0 (Device), 1(USB) and 3(SMS) it is mandatory to specify the correct dtype, did and mid.
This can be used to fetch a specific number of Time and Attendance events in the required format.
Action
action=get
Syntax
[Link]
Parameters
If “field-name” is not
mentioned, then
The list of valid fields is Multiple field-names can be selected,
system should
mentioned in the each separated by “, (comma)”
field-name No consider configured
“Response Fields” e.g.:”indexno, userid, username,
“field-name” for the
section. orgid…”
respective template in
‘API Data Template’.
If count is not
It’s the count up to which the data is
mentioned then
required. It shall be of 3 numeric digits.
system should send
e.g. index=50, and count=100, then
count numeric No 999 (maximum value
system should provide total 100 events,
of count) events from
starting from index =50 up to index
given start point i.e.
=149
index.
Response Fields
M : Male
Gender GENDER F: Female -
NA : Not available
M : Married
Marital Status MRTLSTAT U : Unmarried -
NA : Not available
0 : Entry
Entry/Exit Type ENTRYEXITTYPE -
1 : Exit
0 = Panel,
1 = Direct Door,
2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
Panel/Door Type PANEL_DOOR_TYPE -
5 = Wireless Direct Door
6 = Compact Direct Door
7 = PVR Direct Door
8= Vega Panel-Lite
9= Vega Controller
0=controller
1=USB
2=ESS This will indicate the event
Source event_src 3=SMS source to the COSEC
4=PIM software.
5=Others
6=APP
0 : denied
Access Allowed or Denied access_allowed -
1: allowed
When location is
calculated via GPS. This
GPS Latitude gps_ latitude 9 characters parameter will contain :
latitude
Example: -77.0081
When location is
calculated via GPS. This
GPS Longitude gps_ longitude 9 characters parameter will contain :
longitude
Example: 38.8897
When location is
calculated via GSM. This
GSM Latitude gsm_ latitude 9 characters
parameter will contain :
latitude
When location is
calculated via GSM. This
GSM Longitude gsm_ longitude 9 characters
parameter will contain :
longitude
When location is
calculated via Wi-Fi. This
MAC Address mac_address 17 characters
parameter will contain :
MAC Address of source
Example
Sample Request:
[Link]
Sample Response:
IndexNo|UserID|UserName|EventDateTime|EntryExitType|MasterControllerID|DoorControllerID|SpecialFunctionID|LeaveDT|IDateTime
33|1|sam|01/10/2011 [Link]|0|1|1|0||10/01/2011 [Link]
34|1|sam|03/10/2011 [Link]|0|1|1|0||10/03/2011 [Link]
35|2|hardik|03/10/2011 [Link]|0|1|1|0||10/03/2011 [Link]
36|3|shwetang|03/10/2011 [Link]|0|1|1|0||10/03/2011 [Link]
37|9|home|26/07/2012 [Link]|0|0|0|0||07/26/2012 [Link]
38|9|home|26/07/2012 [Link]|0|0|0|0||07/26/2012 [Link]
39|9|home|26/07/2012 [Link]|0|0|0|0||07/26/2012 [Link]
40|9|home|26/07/2012 [Link]|0|0|0|0||07/26/2012 [Link]
<EOT>
This API is similar to “Obtaining Time and Attendance Events”. However, in this case, the Time and Attendance
events can be obtained for a specified date range.
Action
action=get
Syntax
[Link]
Parameters
If “field-name” is not
mentioned, then
The list of valid fields is Multiple field-names can be selected,
system should
mentioned in the each separated by “, (comma)”
field-name No consider configured
“Response Fields” e.g.:”indexno, userid, username,
“field-name” for the
section. orgid…”
respective template in
‘API Data Template’.
Response Fields
-
Designation ID DSGID 1-999999
M : Male
Gender GENDER F: Female -
NA : Not available
M : Married
Marital Status MRTLSTAT U : Unmarried -
NA : Not available
0 : Entry
Entry/Exit Type ENTRYEXITTYPE -
1 : Exit
0 = Panel,
1 = Direct Door,
2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
Panel/Door Type PANEL_DOOR_TYPE -
5 = Wireless Direct Door
6 = Compact Direct Door
7 = PVR Direct Door
8= Vega panel-lite
9= Vega Controller
0=controller
1=USB
2=ESS This will indicate the event
Source event_src 3=SMS source to the cosec
4=PIM software.
5=Others
6=APP
0 : denied
Access Allowed or Denied access_allowed -
1: allowed
When location is
calculated via GPS. This
GPS Latitude gps_ latitude 9 characters parameter will contain :
latitude
Example: -77.0081
When location is
calculated via GPS. This
GPS Longitude gps_longitude 9 characters parameter will contain :
longitude
Example: 38.8897
When location is
calculated via GSM. This
GSM Latitude gsm_latitude 9 characters
parameter will contain :
latitude
When location is
calculated via GSM. This
GSM Longitude gsm_longitude 9 characters
parameter will contain :
longitude
When location is
calculated via Wi-Fi. This
MAC Address mac_address 17 characters
parameter will contain :
MAC Address of source
Example
This example presents a case where no time-attendance records are available for the specified date range.
Sample Request:
[Link]
Sample Response:
This can be used to get a specific number of Access Control events (All events other than Time and Attendance
events) in the required format.
Action
action=get
Syntax
[Link]
Parameters
If “field-name” is not
mentioned, then
The list of valid fields is Multiple field-names can be selected,
system should
mentioned in the each separated by “, (comma)”
field-name No consider configured
“Response Fields” e.g.:”indexno, userid, username,
“field-name” for the
section. orgid…”
respective template in
‘API Data Template’.
If count is not
It’s the count up to which the data is
mentioned then
required. It shall be numeric digits.
system will send 999
e.g. index=50, and count=100, then
count numeric No (maximum value of
system should provide total 100 events,
count) events from
starts from index =50 up to index =149
given start point i.e.
index.
Response Fields
Allowed characters
A-Z
User ID USERID 10 characters. a-z
0-9
/_\\.@:
Allowed Characters
A-Z
User Name USERNAME 45 characters a-z
0-9
-_. ()[]
0 : Entry
Entry/Exit Type ENTRYEXITTYPE -
1 : Exit
0 = Panel,
1 = Direct Door,
2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
Panel/Door Type PANEL_DOOR_TYPE -
5 = Wireless Direct Door
6 = Compact Direct Door
7 = PVR Direct Door
8= Vega panel-lite
9= Vega Controller
-
Designation ID DSGID 1-999999
0=controller
1=USB
2=ESS This will indicate the event
Source event_src 3=SMS source to the cosec
4=PIM software.
5=Others
6=APP
0 : denied
Access Allowed or Denied access_allowed -
1: allowed
When location is
calculated via GPS. This
GPS Latitude gps_ latitude 9 characters parameter will contain :
latitude
Example: -77.0081
When location is
calculated via GPS. This
GPS Longitude gps_longitude 9 characters parameter will contain :
longitude
Example: 38.8897
When location is
calculated via GSM. This
GSM Latitude gsm_latitude 9 characters
parameter will contain :
latitude
When location is
calculated via GSM. This
GSM Longitude gsm_longitude 9 characters
parameter will contain :
longitude
When location is
calculated via Wi-Fi. This
MAC Address mac_address 17 characters
parameter will contain :
MAC Address of source
Example
Sample Request:
[Link]
Sample Response:
IndexNo|UserID|UserName|EventDateTime|EntryExitType|MasterControllerID|DoorControllerID|IDateTime
30904|555013|KRISHNANAND SHIVRATAN PAL|23/02/2013 [Link]|0|48|1| 30905|555013|KRISHNANAND SHIVRATAN PAL|23/02/
2013 [Link]|0|48|1|
30906|8515|KARANSINGH DILBAHADUR DHAMI|23/02/2013 [Link]|0|48|1|
30907|8699|RAJIV RANJAN PRAKASH SINGH|23/02/2013 [Link]|0|48|1|
30908|8515|KARANSINGH DILBAHADUR DHAMI|23/02/2013 [Link]|0|48|1|
30909|8515|KARANSINGH DILBAHADUR DHAMI|23/02/2013 [Link]|0|48|1| 30910|555013|KRISHNANAND SHIVRATAN PAL|23/02/
2013 [Link]|0|48|1|
30911|8515|KARANSINGH DILBAHADUR DHAMI|23/02/2013 [Link]|0|48|1|
30912|8699|RAJIV RANJAN PRAKASH SINGH|23/02/2013 [Link]|0|48|1|
30913|8699|RAJIV RANJAN PRAKASH SINGH|23/02/2013 [Link]|0|48|1|
30914|555013|KRISHNANAND SHIVRATAN PAL|25/02/2013 [Link]|0|48|1|
This API is similar to “Obtaining Access Control Events”. However, in this case, the Access Control events can be
obtained for a specified date range.
Action
action=get
Syntax
[Link]
Parameters
If “field-name” is not
mentioned, then
The list of valid fields is Multiple field-names can be selected,
system should
mentioned in the each separated by “, (comma)”
field-name No consider configured
“Response Fields” e.g.:”indexno, userid, username,
“field-name” for the
section. orgid…”
respective template in
‘API Data Template’.
Response Fields
Allowed characters
A-Z
User ID USERID upto 10 characters. a-z
0-9
/_\\.@:
Allowed Characters
A-Z
User Name USERNAME upto 45 characters a-z
0-9
-_. ()[]
0 : Entry
Entry/Exit Type ENTRYEXITTYPE -
1 : Exit
0 = Panel,
1 = Direct Door,
2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
Panel/Door Type PANEL_DOOR_TYPE -
5 = Wireless Direct Door
6 = Compact Direct Door
7 = PVR Direct Door
8= Vega panel-lite
9= Vega Controller
-
Designation ID DSGID 1-999999
0=controller
1=USB
2=ESS This will indicate the event
Source event_src 3=SMS source to the cosec
4=PIM software.
5=Others
6=APP
0 : denied
Access Allowed or Denied access_allowed -
1: allowed
When location is
calculated via GPS. This
GPS Latitude gps_ latitude 9 characters parameter will contain :
latitude
Example: -77.0081
When location is
calculated via GPS. This
GPS Longitude gps_longitude 9 characters parameter will contain :
longitude
Example: 38.8897
When location is
calculated via GSM. This
GSM Latitude gsm_latitude 9 characters
parameter will contain :
latitude
When location is
calculated via GSM. This
GSM Longitude gsm_longitude 9 characters
parameter will contain :
longitude
When location is
calculated via Wi-Fi. This
MAC Address mac_address 17 characters
parameter will contain :
MAC Address of source
Example
The following example illustrates a case where no records of access control events are present in the given date
range.
Sample Request:
[Link]
Sample Response:
IndexNo|UserID|UserName|EventDateTime|EntryExitType|MasterControllerID|DoorControllerID|IDateTime
1890|112|PARESH CHAUHAN|01/01/2012 [Link]|0|4|1|01/01/2012 [Link]
1921|443|BHARGAV M PATEL|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1923|112|PARESH CHAUHAN|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1924|621|patel vishal H|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1925|521|PRAVINSINH GANPATSINH CHAUHAN|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1926|489|KADIR I MANSURI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1927|424|VIMAL S TADVI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1928|684|JADAV MAYUR G|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1929|449|CHINTAN A VARU|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1930|644|Dhramesh Thakkar|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1931|496|MILAN TRIVEDI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1932|515|KAMLESH KANUBHAI PARMAR|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1933|498|RAVINDRA RAJPUT|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1934|686|Saikh Sajid Usmanbhai|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1935|514|BABU MANSUKHBHAI PALASH|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1936|417|RAJESH P MACHHI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1937|434|KISHOR SOLANKI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1938|5|AMBALAL PADHIYAR|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
1940|4|DEVENDRA L MACHHI|02/01/2012 [Link]|0|4|1|01/02/2012 [Link]
This will be used to fetch the COSEC door, alarm and system events for a specified date range. The date should be
insertion date and all the events that are offline and yet to be inserted will be left out.
Action
action=get
Syntax
[Link]
Parameters
Response Fields
0: all (default)
1: door
Event Type type -
2: alarm
3. system
Events Reference
314 RTC
405 Enrolment
• The status changes are not registered as new events, as they are being updated against the current
event itself.
The events returned will be ordered according to the date-time of the event (edatetime)
This API can be used to send a command to a COSEC device from a third-party application. Certain commands
can be sent directly to devices to initiate specific actions. The following commands can be sent to a COSEC device
via API:
• Set Date-Time - Sends the current system date and time to the device.
• Normalize Door/Lock Door/Unlock Door - Sends the appropriate commands to the DOOR to reset the
door lock status.
• Delete FP - Sends command to delete the fingerprints (FP) from the fingerprint module of a device.
• Sync Credentials - Sends command to synchronize credentials from the PANEL to the DOORs. It is
recommended to first send the delete fingerprints command to the DOORs before starting the
synchronizing process for finger print templates.
• Clear All Alarms - Sends the command to clear all alarms configured on the COSEC system.
• Factory Defaults - Sends the command to default the device settings to the default factory settings.
• Delete Palms - Sends command to delete the palm templates from a palm vein reader device.
Action
action=command
Syntax
[Link]
Parameters
1 to 65000
(panel, panel-lite)
device-id Yes - This is the device identification number.
1 to 65000
(direct doors)
Here,
0 = Panel,
0,1,2,3,4,5,6,7,8,9 1 = Direct Door V1,
device-type Yes - 2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
5 = Wireless Direct Door
6 = Path Controller
7 = PVR Direct Door
8 = Vega Panel-Lite
9 = Vega Controller
1 - set date-time
2 - normalize door
3 - lock door
4 - unlock door
5 - delete FP (clears all
command-type Yes - To specify a command.
finger prints)
6 - sync credentials
7 - clear all alarms
8 - factory defaults
9 - delete palms
Example
The following is an example of a command sent to a panel door for credentials synchronization:
Sample Request:
[Link]
no=1;command-type=6;
Sample Response:
Sample Request:
[Link]
no=1;command-type=7;
Sample Response:
Request the total count of users assigned on a device by specifying the device type and device ID.
Action
action=get
Syntax
[Link]
Parameters
1 to 65000
(panel, panel-lite)
device-id Yes - This is the device identification number.
1 to 65000
(direct doors)
Here,
0 = Panel,
0,1,2,3,4,5,6,7,8,9 1 = Direct Door V1,
device-type Yes - 2 = Panel Lite
3 = Direct Door V2,
4 = NGT Direct Door,
5 = Wireless Direct Door
6 = Path Controller
7 = PVR Direct Door
8 = Vega Panel-Lite
9 = Vega Controller
Example
The following is an example of a request sent to “matrixserver” to obtain the user count for a Direct Door V2 with
device-id=1,
Sample Request:
[Link]
DeviceID|DeviceName|UserCount|TotalUserCapacity
11|RnD Basement V2|464|2000
<EOT>
The called HTTP request shall be parsed by the system before it returns an appropriate response depending on the
nature of success or failure. Some common response messages are as follows:
• If a request is successful:
<success: successful>
• “ * ” Specifies the value mentioned in the request against its respective arguments.
Example
The following examples illustrate some common error response cases that the user may encounter when sending
an HTTP query:
Error Request:
[Link]
Error Request:
[Link]
Error Response:
Error Request:
• Invalid range.
[Link]
Error Response:
Error Request:
[Link]
Error Response:
Corporate Office:
394-GIDC, Makarpura, Vadodara - 390010, India.
Ph.:+91 265 2630555, Fax: +91 265 2636598
E-mail: Info@[Link]
Manufacturing Unit:
15 & 19 GIDC, Waghodia - 391760, Dist. Vadodara, India.
Ph.: +91 2668 263172/73
Customer Care:
Ph.: +91 265 2630555
E-mail: [Link]@[Link], Support@[Link]
[Link]