Академический Документы
Профессиональный Документы
Культура Документы
SiPass® integrated
MP2.70 SP1
Contents
2 Introduction ............................................................................................. 8
2.1 The SiPass integrated API ........................................................................ 9
2.2 Object Model Overview ........................................................................... 10
2.3 Requirements .......................................................................................... 12
3
Building Technologies A-100084-1
02.2018
About this document
3.20 IAdvCardLayout Object ........................................................................... 51
3.20.1 Example .................................................................................................. 51
3.21 Access Control Manager Object ............................................................. 52
3.21.1 Example .................................................................................................. 53
3.22 Access Groups Object ............................................................................ 54
3.23 Access Group Object .............................................................................. 55
3.23.1 Example .................................................................................................. 56
3.23.2 Accessing Access Group attributes ........................................................ 56
3.23.3 Access Group attribute names ................................................................ 57
3.24 Access Group Info Object ....................................................................... 57
3.24.1 Example .................................................................................................. 58
3.25 AdvAccessLevelInfo ................................................................................ 58
3.26 AdvAccessLevelItem ............................................................................... 59
3.27 Access Levels Object .............................................................................. 59
3.26.1 Example ....................................................................................................... 60
3.28 Access Level Object ................................................................................ 60
3.27.1 Example ...................................................................................................... 61
3.29 IAdvAccessComponent ........................................................................... 61
3.30 IAdvAccessComponentCollection ........................................................... 62
3.31 IAdvAccessComponentReader ............................................................... 62
3.32 AdvAccessComponentType .................................................................... 63
3.33 IAdvAccessGroupManager ..................................................................... 63
3.33.1 Example .................................................................................................. 64
3.34 IAdvAccessLevelManager ....................................................................... 64
3.35 IAdvAccessPolicy .................................................................................... 65
3.36 AdvAccessRule ....................................................................................... 67
3.37 AdvAccessRuleType ............................................................................... 68
3.38 AdvControlMode ..................................................................................... 68
3.39 AdvArmingRights .................................................................................... 69
3.40 IAdvCommon........................................................................................... 69
3.41 IAdvFilter ................................................................................................. 70
3.42 ComparisonOperator ............................................................................... 71
3.43 AdvFilterEntry .......................................................................................... 72
3.43.1 Field Names to be used in Filtering......................................................... 72
6 Troubleshooting .................................................................................... 92
5
Building Technologies A-100084-1
02.2018
About this document
Operation Guide
®
The SiPass integrated HR API Programmer’s Guide has been prepared to provide
you with information concerning how to program a third party application to
interface via the HR API. It has been produced for new and experienced users of
Siemens Building Technologies access control products and systems. This guide
should be used in conjunction with the SiPass integrated Installation and User‟s
manuals.
Disclaimer
Although reasonable care was taken in producing this manual, no responsibility is
accepted by Siemens or its agents or employees for the accuracy or safety of the
material contained herein. None of the equipment described in this guide is
suitable for use in an application where life or health depends on its correct
operation. Siemens reserves the right to vary the specifications, standards and
method of operation of any or all of the equipment described herein at any time
without notice to any party.
No liability can be assumed for direct or consequential losses and third-party
damages arising from the purchase of this product. In all cases, liability is limited to
the purchase price of the product.
The information contained herein was up to date at the time of publication. We
reserve the right to make subsequent changes to technical or organizational
details. Siemens assumes no liability for problems resulting from the use of this
manual.
The information contained in this document may be changed without prior notice.
Siemens reserves the right to publicize any such changes by issuing updated
versions or new editions.
It is not permitted to reproduce this manual in whole or in part or translate it into
another language without our written consent.
Trademarks
SiPass is a trademark of Siemens CPS Fire Safety
Contacting us
If you have questions or suggestions regarding the product or this documentation,
please contact your local SiPass representative.
The following table outlines the changes or additions made to this guide since the
previous revision of the guide was released.
7
Building Technologies A-100084-1
02.2018
Introduction
2 Introduction
®
This Reference Manual explains how to access and maintain SiPass integrated
cardholder information from a software application external to SiPass, such as a
Human Resources application.
This guide has been produced as a reference for any personnel developing or
extending software applications that require access to SiPass integrated data. This
guide should be used in conjunction with the SiPass integrated Installation and
User Guide.
®
This chapter provides a brief explanation of the SiPass integrated API object
model, and the requirements that need to be met before you can access these
objects from another programming language.
Information in this chapter includes:
SiPass integrated API Overview
Object Model Overview
8
Building Technologies A-100084-1
02.2018
Introduction
2.1 The SiPass integrated API
The SiPass integrated automation object model allows SiPass integrated data to
be accessed and maintained from any programming language that supports COM
automation. Examples given in this document are written in C#.
Connections to a SiPass integrated server are made by the creation of a Session
object, through which an EmployeeManager object can be accessed. The
EmployeeManager object in turn controls access to Workgroups and Employees
objects, which are collections of individual records respectively. Similarly, the
AccessControlManager object controls access to AccessGroups and
AccessLevels. The VenueManager object controls fetching and modification of
venues. The VenueBookingManager controls fetching and modification of venue
bookings.
Each object contains methods and properties through which records can be
created, modified, added and saved to the SiPass integrated database.
A valid username and password must be supplied for a successful connection to a
SiPass integrated server. Access to workgroups and cardholders is determined by
the level of access of the username passed to the Session object. For more
information on assigning system functions and access privileges to SiPass
integrated operators, see Operator Groups, SiPass integrated User‟s Guide.
The described methods throughout this document will not change except under exceptional
circumstances, where clear notice will be provided. However, undocumented methods may be subject
to change without any prior notice
9
Building Technologies A-100084-1
02.2018
Introduction
Object Description
Employees A collection of all the employees that the logged on operator has
permission to manage.
Workgroups A collection of all of the workgroups that the logged on operator has
permission to manage.
Access Groups A collection of all the access groups that the logged on operator has
permission to manage.
Access Group Info Contains the name, ID and an access level collection of the access
group. The Access Group Info object is a property of each Access
Group object.
Access Levels A collection of all the access levels that the logged on operator has
permission to view.
Card Layouts A collection of all the card layouts (templates) that the logged on
operator has permission to view.
Card Layout Represents a card template, with ability to view the name
IAdvAccessGroupManager Used to create new access group objects, as well as retrieving and
deleting existing access group objects
IAdvAccessLevelManager Used to create new access level objects, as well as retrieving and
deleting existing access level objects
AdvAccessRule Represents a single access rule. Multiple access rules can form an
access policy
IAdvFilter A filter that can be passed in for various queries to limit the results
10
Building Technologies A-100084-1
02.2018
Introduction
Object Description
returned
ComparisonOperator Enumeration for the possible comparison logic for a single filter entry
AdvEventType Enumeration for the possible event types that the server can send the
HR-API application (i.e. insert, modify, delete)
AdvObjectEventInfo Structure representing the details of an object event sent from SiPass
integrated server to the HR-API application
AdvAccessPolicyEventInfo Structure representing the details of an access policy event sent from
SiPass integrated server to the HR-API application
AdvAccessComponentType Enumeration for the possible point and point group types supported in
HR-API
IAdvEmployeeField Holds the information about an employee custom field (e.g. name,
data type)
11
Building Technologies A-100084-1
02.2018
Introduction
Object Description
2.3 Requirements
It is assumed that the reader is familiar with Microsoft C#, or similar object-
oriented programming language and concepts.
The programming language you are using to call the SiPass integrated API
must be COM-compatible.
SiPass integrated Operation Client must be installed on a remote client
computer to run the HR-API application.
12
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
This chapter describes each object in detail and explains how to access and
modify SiPass integrated data using the object model.
Information in this chapter includes:
Accessing SiPass integrated objects
Object Reference
13
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
This section provides a reference for the SiPass integrated objects in the API.
3.2.1 Visual C#
In Microsoft Visual C++ version 5.0 or later, you can use the #import directive to
import information directly from a type library. The type libraries for the SiPass
integrated objects are in “AdvServ.tlb” and “AdvComApi.dll”. These files need to be
loaded in order to obtain all of the type information described in this document.
Refer to the Visual C++ documentation for information on the #import directive.
For HR-API applications running for extended periods, it is strongly recommended to use the
C# Marshal.ReleaseComObject() method (or an equivalent call for other managed languages) to
release COM objects when not required.
For more detailed overview of COM object management from managed code, click the link below:
https://msdn.microsoft.com/en-
us/library/office/aa159887(v=office.11).aspx#odc_ofcomplexcomobjectspias_comandnetbasedmemor
ymanagement
14
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.3 Object Reference
This section lists a description of each available object and its properties and
methods. A syntax and usage example can be found in each of the descriptions.
3.3.1 Session Object
ServerName String Used to obtain or set the name of the SiPass integrated server
used by the Connect method. This property cannot be changed
once the session is connected.
If this property is not set before the call to Connect, the default
SiPass integrated server name (set when SiPass integrated is
installed) will be used
Server IAdvServer Used to obtain the server object to which the session is
connected. If the session is not connected, accessing this
property will cause an error.
LogOnObject IAdvLogOn Used to obtain the logon object to which the session is
connected. If the session is not connected, accessing this
property will cause an error.
Methods
15
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
corresponding password.
<hwnd> A window handle to use as the parent for the Logon dialog box.
This parameter can be null.
Logoff None Logs an operator off from a SiPass integrated server. If the logon
has not been performed for this session, an error is generated.
CancelLogon None Cancels the logon process where the logon is waiting for input
from a user.
3.3.2 Example
The following example shows the creation and the use of a session object:
Visual C#
Properties
17
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.4.1 Example
Visual C#
18
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Methods
19
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
card technologies in the system.
eventsCallback
Object implementing
IAdvEmployeeWorkgroupsEventsCallback
interface
20
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
construct credential objects
3.5.1 Example
The following example shows the use of the Employee Manager object and its
accessor functions:
Visual C#
ADVCOMAPILib.IAdvEmployees employees;
ADVCOMAPILib.IAdvEmployee employee;
ADVCOMAPILib.IAdvWorkgroups workgroups;
ADVANTAGELib.IAdvEmployeeManager employeeManager;
employees = server.EmployeeManager.GetEmployees();
employee = server.EmployeeManager.CreateNewEmployee();
workgroups = server.EmployeeManager.GetWorkgroups();
employeeManager =
(ADVANTAGELib.IAdvEmployeeManager)server.EmployeeManager;
21
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.5.2 Example
The following example shows the use of IAdvEmployeeManager to obtain all the
Credential Profiles in SiPass integrated.
Visual C#
22
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.5.3 Example
IAdvEmployeeManager lEmployeeManager =
(IAdvEmployeeManager)mServer.EmployeeManager;
IIAdvCredentialProfileCollection lCredentialProfiles =
lEmployeeManager.FetchCredentialProfiles();
IAdvCredentialProfile lNewCredentialProfile =
lEmployeeManager.CredentialProfileFactory.CreateCredentialProfile();
lCardTechnology = cardTech;
break;
lNewCredentialProfile.CardTechnology = lCardTechnology;
lNewCredentialProfile.FacilityCode = "0";
lNewCredentialProfile.ValidityCode = "0";
lNewCredentialProfile.PINDigits = 4;
lNewCredentialProfile.PINMode = AdvPINMode.AdvCardAndPIN;
lCredentialProfiles.Add(lNewCredentialProfile);
lEmployeeManager.SaveCredentialProfiles(lCredentialProfiles);
23
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
lCredentialProfiles = lEmployeeManager.FetchCredentialProfiles();
profile.PINDigits = 8;
lEmployeeManager.SaveCredentialProfiles(lCredentialProfiles);
break;
lCredentialProfiles = lEmployeeManager.FetchCredentialProfiles();
lProfileToDelete = (IAdvCredentialProfile)profile;
break;
lCredentialProfiles.Remove(lProfileToDelete);
lEmployeeManager.SaveCredentialProfiles(lCredentialProfiles);
24
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Count Integer Used to obtain a count of the Employee objects in the collection.
Methods
Remove Deletes an Employee object from the collection and removes the
employee from SiPass integrated.
EmployeesObject.Remove <employee>
25
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
EmployeesObject.SetFilter <NamesArray>, <ValuesArray>
In addition to the above methods, the Employees object supports the “For Each”
coding statement.
3.6.1 Example
Visual C#
ADVCOMAPILib.IAdvEmployees employees;
employees = server.EmployeeManager.GetEmployees();
// print out first name of each employee
foreach (ADVCOMAPILib.IAdvEmployee employee in employees)
{
System.Diagnostics.Debug.Write(employee["FirstName"]);
}
// add new employee
employee = server.EmployeeManager.CreateNewEmployee();
// set properties here for new employee
employees.Add(employee);
26
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.7 Employee Object
27
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
BiometricEncodedFingers
AdvFingerIndex array Returns information on which
fingers are used in biometric
encoding
AccessPolicy
IAdvAccessPolicy Returns the employee‟s
access policy
Workgroups
IAdvWorkgroups Returns a collection of
workgroups assigned to the
employee
BiometricData
SAFEARRAY(BYTE)* Returns an array of bytes
representing the Biometric
Credential data (in Bioscrypt
format)
Credentials
IAdvCredentialCollection Returns a collection of
credentials (cards) belonging
to the employee object
28
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.7.1 Example
ADVCOMAPILib.IAdvEmployees employees;
employees = server.EmployeeManager.GetEmployees();
employee.SaveChanges();
3.7.2 Example
The following examples show how to Create, Modify and Delete a Credential (card)
for an employee:
// 1) Add a new card for "John Smith" in SiPass
IAdvEmployeeManager lEmployeeManager =
(IAdvEmployeeManager)mServer.EmployeeManager;
AdvCredential lCredential =
lEmployeeManager.CredentialFactory.CreateCredential();
IAdvEmployees lEmployees =
(IAdvEmployees)lEmployeeManager.GetEmployees();
emp["FirstName"].ToString() == "John")
lEmployee = emp;
break;
29
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
lCredential.CardNumber = "222";
lCredential.PINNumber = "1234";
lCredential.StartDate.Date = DateTime.Today;
lCredential.EndDate.Date = DateTime.Today.AddDays(1);
lCredential.CredentialProfile = "MyNewCredentialProfile";
lCredential.Active = true;
lEmployee.Credentials.Add(lCredential);
lEmployee.SaveChanges();
lEmployee = null;
emp["FirstName"].ToString() == "John")
lEmployee = emp;
break;
if (credential.CardNumber == "222")
lCredentialToEdit = credential;
break;
lCredentialToEdit.CardNumber = "333";
lEmployee.SaveChanges();
lEmployee = null;
30
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
AdvCredential lCredentialToDelete = null;
emp["FirstName"].ToString() == "John")
lEmployee = emp;
break;
if (credential.CredentialProfile == "MyNewCredentialProfile")
lCredentialToDelete = credential;
break;
lEmployee.Credentials.Remove(lCredentialToDelete);
lEmployee.SaveChanges();
31
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.7.3 Example
The following example shows how to delete all cards belonging to an employee:
lEmployee = null;
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "FirstName",
value = "John"
});
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "LastName",
value = "Smith"
});
lEmployees =
mServer.EmployeeManager.GetEmployeesWithFilter(lFilter);
lEmployee = lEmployees.Item(0);
lEmployee.Credentials.Clear();
lEmployee.SaveChanges();
3.7.4 Example
The following example shows how to get all cards (credentials) assigned to an
employee:
lEmployee = null;
32
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "FirstName",
value = "John"
});
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "LastName",
value = "Smith"
});
lEmployees =
mServer.EmployeeManager.GetEmployeesWithFilter(lFilter);
lEmployee = lEmployees.Item(0);
Console.Out.WriteLine("CardNumber:" + credential.CardNumber);
Console.Out.WriteLine("PINNumber:" + credential.PINNumber);
Console.Out.WriteLine("CredentialProfile:" +
credential.CredentialProfile);
Console.Out.WriteLine("--------------------------------");
3.7.5 Example
The following example shows how to get all Workgroups (partition and non-
partition) assigned to an employee:
33
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
{
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "FirstName",
value = "John"
});
op = ADVCOMAPILib.ComparisonOperator.Equal,
propertyName = "LastName",
value = "Smith"
});
lEmployees =
mServer.EmployeeManager.GetEmployeesWithFilter(lFilter);
lEmployee = lEmployees.Item(0);
Console.Out.WriteLine("Name:" + group.Name);
if (group.Partition)
else
34
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Access to attributes, including the ability to read, modify and delete attributes of the
Employee object is dependent on the access privileges of the operator who is
currently logged in.
35
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
36
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
This property is associated with the
primary partition workgroup
assigned.
ImageUpdateDate Date - Yes No Indicates the date and time that the
cardholder‟s image was last
updated.
37
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
ImageName String - Yes No The UNC filename of the image
stored for this employee.
SiPass integrated provides support for up to 19 digit card numbers for all cards.
The maximum number of digits allowed for the CardNumber field depends on the
Card Technology selected in the credential profile.
Similarly, while SiPass integrated provides support for up to 8 digit PIN numbers,
the actual number of digits required in the PinNumber attribute will depend on the
Credential Profile settings.
Specifying a PIN
In order to select a specific PIN for a cardholder, you will first need to set the card
number. PINs are auto generated after a card number is set to a cardholder. To
override the auto generated PIN, the card number must first be set, otherwise
setting the PIN before the card number will create an automatic PIN.
38
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Voiding a Card
The Void property is only ever used to set a card to void status. It should never be
read to find out a card status. To find out the status of a card, the CardStatus
property should be read first.
To set a card to Void, first verify that the CardStatus property either has a value of
“0” (valid) or “1” (void). If it is, you can safely set the Void property to TRUE or
FALSE. If the value of the Cardstatus property is other than 0 or 1, an error will be
generated if an attempt is made to set the Void property value.
Custom field attributes are determined by the properties defined in the SiPass
integrated Cardholder Custom Page Design dialog during creation.
Read Only False. All custom fields are set to read/write enabled.
3.7.9 Example
The following example shows how to access custom and fixed employee
properties:
Visual C#
ADVCOMAPILib.IAdvEmployees employees;
IAdvEmployees.IAdvEmployee employee;
string txtLockerNo;
string txtLockerLoc;
employees = server.EmployerManager.GetEmployees();
foreach(ADVCOMAPILib.IAdvEmployee employee in employees)
{
txtLockerNo = employee[“LockerNo”].ToString();
txtLockerNo = employee[“LockerLoc”].ToString();
// comment: Fields “LockerLoc” and “LockerNo” must be
appropriately defined as custom fields in SiPass
System.Diagnostics.Debug.Write(“Locker for ” +
employee[“LastName”] + “, “ + employee[“FirstName”] + “ is
number: “ + txtLockerNo + “ in building : “ + txtLockerLoc);}
39
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.8 IAdvCredentialProfileFactory Object
Methods
Methods
40
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Name string Gets / sets the name of the credential profile. Please note
that this name cannot contain any spaces.
CardTechnology IAdvCardTechnology Gets / sets the card technology associated with this
credential profile
FacilityCode string Gets / sets the facility code of this credential profile (if
applicable)
ValidityCode string Gets / sets the validity code of this credential profile (if
applicable)
PINDigits int Gets / sets the number of PIN digits that this credential
profile uses. If a PIN input is being used in this profile,
then PINDigits should be set to a number between 4 and
8.
41
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Methods
42
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Revision int Gets / sets the revision number of the card (if
applicable)
PINNumber string Gets / sets the PIN Number of this credential (if
applicable)
LastUsedDate Date Gets the date/time value for the most recent card
badge. If never badged, the value returned is the
base OLE automation date (1899).
LastUsedArea string Gets the name of the area for the most recent card
badge. If no area was involved the value returned is
null.
LastUsedReader string Gets the name of the reader for the most recent card
badge
43
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Methods
44
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.14 AdvPINMode
An enumeration that represents the PIN mode in use for a credential profile.
The enumeration constants available are:
AdvPINMode.AdvCardAndPIN,
AdvPINMode.AdvCardOnly,
AdvPINMode.AdvPINOnly
Properties
FacilityCodeDigits int Gets the number of digits that form the facility code for a given
card technology.
CardNumberDigits int Gets the maximum number of digits in a card number for a
given card technology.
45
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Methods
Count Integer Used to obtain a count of the Workgroup objects in the collection.
46
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Methods
Item Used to retrieve the work group object for a given index.
This method will raise an error if the collection is empty or
an incorrect index was specified.
SetTypeQualifier Sets the work group type so that workgroups retrieved from
the database are filtered on this type only.
<WorkGroup The work group type (short) to filter on. SiPass integrated
Type> has 4 different enumerated group types;
WG_CONTRACTOR = 1, WG_OTHER = 2, WG_VISITOR =
3, WG_DEPARTMENT = 0
47
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.17.1 Example
ADVCOMAPILib.IAdvWorkgroups workgroups;
ADVCOMAPILib.IAdvWorkgroup workgroup;
// get workgroups object from employee manager
workgroups = server.EmployeeManager.GetWorkgroups();
workgroup = workgroups.GetDefaultWorkgroup();
System.Diagnostics.Debug.Write(workgroup.Name);
Methods
Properties
48
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Applicable only for visitor workgroup type.
3.18.1 Example
Visual C#
ADVCOMAPILib.IAdvWorkgroups workgroups;
ADVCOMAPILib.IAdvWorkgroup workgroup;
workgroups = EmployeeManager.GetWorkgroups();
// Print out name and void status of each workgroup
foreach(ADVCOMAPILib.IAdvWorkgroup workgroup in workgroups)
{
System.Diagnostics.Debug.Write( “Workgroup void: ” +
workgroup.Void);
}
49
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Methods
3.19.1 Example
Visual C#
ADVANTAGELib.IAdvCardLayouts cardlayouts;
ADVANTAGELib.IAdvCardLayout cardlayout;
// get cardlayouts object from employee manager
cardlayouts = ((ADVANTAGELib.IAdvEmployeeManager)
server.EmployeeManager).GetCardLayouts();
50
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Name String Used to obtain the name of the card template. This field is
read-only.
3.20.1 Example
Visual C#
ADVANTAGELib.IAdvCardlayouts cardlayouts;
ADVANTAGELib.IAdvCardlayout cardlayout;
// get cardlayouts object from employee manager
cardlayouts = ((ADVANTAGELib.IAdvEmployeeManager3)
server.EmployeeManager).GetCardLayouts();
51
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
id Time schedule id
52
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.21.1 Example
The following example shows how to access the Access Control Manager object:
Visual C#
ADVANTAGELib.IAdvAccessGroups accessGroups;
accessGroups =
((ADVANTAGELib.IAdvAccessGroups)server.AccessControlManager).
GetAccessGroups();
ADVANTAGELib.IAdvAccessGroup accessGroup;
// Assuming there‟s at least one acc group in the collection
accessGroup = (ADVANTAGELib.IAdvAccessGroup)
accessGroups.Item(0);
ADVCOMAPILib.IAdvEmployees employees;
ADVCOMAPILib.IAdvEmployee employee;
employees = server.EmployeeManager.GetEmployees();
// Assuming there‟s at least one employee in the collection
employee = (ADVCOMAPILib.IAdvEmployee) employees.Item(0);
53
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.22 Access Groups Object
Properties
Count Integer Used to obtain a count of the Access Group objects in the
collection.
Method
Item Used to retrieve the access group information for a given index. This
method will raise an error if the collection is empty or an incorrect index
was specified.
Add Adds an Access Group object to the collection and saves the access
group details in SiPass integrated. This object must be created via the
Access Control Manager object.
<AccessGroup> An IAdvAccessGroup object. All properties for the access group must be
set before the object can be added to the collection and saved.
Remove Removes the specified Access Group object form the collection and
from SiPass integrated.
54
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Methods
55
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.23.1 Example
The following example shows how to access the Access Group object:
Visual C#
ADVANTAGELib.IAdvAccessGroups accessGroups;
ADVANTAGELib.tagAdvAccessGroupInfo accessGroupInfo;
accessGroups =
((ADVANTAGELib.IAdvAccessGroups)server.AccessControlManager).
GetAccessGroups();
// Print out name of each Access Group in SiPass
foreach(ADVANTAGELib.IAdvAccessGroup accessgroup in
accessGroups)
{
accessgroup.GetProperties(out accessGroupInfo);
System.Diagnostics.Debug.Write (accessGroupInfo.bstrName);
}
Access to attributes, including the ability to read and modify attributes of the
Access Group object is dependant on the operator‟s access privileges who is
currently logged in.
56
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
57
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.24.1 Example
ADVANTAGELib.IAdvAccessGroups accessGroups;
ADVANTAGELib.tagAdvAccessGroupInfo accessGroupInfo;
accessGroups =
((ADVANTAGELib.IAdvAccessGroups)server.AccessControlManager).
GetAccessGroups();
// Print out name of each Access Group in SiPass
foreach(ADVANTAGELib.IAdvAccessGroup accessgroup in
accessGroups)
{
accessgroup.GetProperties(out accessGroupInfo);
System.Diagnostics.Debug.Write (accessGroupInfo.bstrName);
}
3.25 AdvAccessLevelInfo
58
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.26 AdvAccessLevelItem
Structure containing the details of a point or point group, and extra intrusion-
specific configuration. This structure information is used as a parameter when
assigning specific points or point groups to an access level.
The structure members are as follows:
Count Integer Used to obtain a count of the Access Level objects in the
collection.
Methods
Item Used to retrieve the access level information for a given index. This method
will raise an error if the collection is empty or an incorrect index was
specified.
In addition to the above, the Access Levels object supports the “For Each” coding
statement.
59
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.26.1 Example
The following example shows how to access the Access Levels object:
Visual C#
accessLevels =
((ADVANTAGELib.IAdvAccessControlManager)(server.AccessControl
Manager)). GetAccessLevels();
60
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
Item
3.27.1 Example
The following example shows how to access the Access Level object:
Visual C#
ADVANTAGELib.IAdvAccessLevels accessLevels;
accessLevels =
((ADVANTAGELib.IAdvAccessControlManager)(server.AccessControl
Manager)). GetAccessLevels();
3.29 IAdvAccessComponent
type AdvAccessComponentType Enum value for the type of point or point group
61
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.30 IAdvAccessComponentCollection
Properties
Methods
3.31 IAdvAccessComponentReader
Used to retrieve a collection of points or point groups of a certain type, in the form
of an IAdvAccessComponentCollection
62
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.32 AdvAccessComponentType
Enumeration for the possible point and point group types supported for an
IAdvAccessComponent object
Value Description
3.33 IAdvAccessGroupManager
63
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.33.1 Example
3.34 IAdvAccessLevelManager
Supports the creation, retrieval and deletion of access levels
The following methods are available:
64
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.35 IAdvAccessPolicy
Properties
Methods
65
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
AddAccessLevel Add an IAdvAccessLevel, which will be
internally converted to an AdvAccessRule
when adding to the IAdvAccessPolicy
66
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.36 AdvAccessRule
67
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.37 AdvAccessRuleType
Value Description
3.38 AdvControlMode
Value Description
68
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.39 AdvArmingRights
Value Description
3.40 IAdvCommon
Methods
69
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.41 IAdvFilter
When retrieving a collection of employees, venues, etc, we may wish to limit the
results we receive, based on a property comparison (e.g. name match), max row
limit, or skipping a specified number of records first (i.e. paging through the
results). An IAdvFilter object can be passed in as an input parameter in the query
to achieve this.
An IAdvFilter consists of one or more AdvFilterEntry objects. The filter result is
determined by satisfying all the AdvFilterEntry objects (i.e. „AND‟ logic across all
AdvFilterEntry objects)
Supports the following methods and properties:
Methods
70
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Properties
MaxObjects Integer Get/set the limit of the number of records to retrieve when
retrieving a collection of records. This property could be used for
paging of results (in conjunction with SkipObjects property), or to
limit the max row result for memory or performance reasons.
SortBy string Get/set a field name of the records we are retrieving. If set, the
records will be returned in sorted order according to the field
name (e.g “Name”)
SortDesc boolean If sorting by a field name, set to true if you want to sort in
descending order. The default is false, which means an
ascending sort.
3.42 ComparisonOperator
Value Description
NotEqual The input value does not exactly match the field value
LessThanOrEqual The field value is less than or equal to the input value
GreatherThanOrEqual The field value is greater than or equal to the input value
BeginsWith The field value begins with the input value string
EndsWith The field value ends with the input value string
AnyOf The field value exactly matches any input value from an
input value collection
71
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.43 AdvFilterEntry
Structure representing the details of a single filter, where a field value is compared
to an input value. Multiple AdvFilterEntry objects can be added to an IAdvFilter
object. This IAdvFilter object is then passed in as a parameter for some object
collection queries (e.g. employees, venues, etc).
The structure members are as follows:
EmployeeId
FirstName
LastName
EmployeeNumber
Title
Address
PhoneNumber
MobileNumber
PagerNumber
EmailAddress
PayrollNumber
IAdvEmployee
CarRego1
CarModel1
CarColour1
CarRego2
CarModel2
CarColour2
GeneralData
PrimaryWorkgroupId
ApbWorkgroupId
PinNumber (note: for base
credentials only)
2ndPinNumber (note: for all
72
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
base and non-base
credentials)
CardNumber (note: for base
credentials only)
2ndCardNumber (note: for all
base and non-base
credentials)
primaryWorkgroupName
StartDateTime
EndDateTime
UseEmail
Isolate
Visitor
IsVoid
Accessibility
TimedReEntryExclusion
Supervisor
SelfAuthorise
APBExclusion
SmartCardProfileId
MobileServiceProviderId
PagerServiceProviderId
DateOfBirth
CardTrace
Id
IAdvAccessGroup
Name
Id
Name
IAdvAccessLevel
TimeSchedule.Id
TimeSchedule.Name
Id
Name
IAdvWorkgroup
Type
Partition
Id
IAdvAccessComponent
Name
venue_Id
IAdvVenue Name
Description
Id
VenueId
Name
Description
IAdvVenueBooking
RequireAuthentication
StartDateTime
EndDateTime
VenueName
73
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.44 IAdvTimeSchedule
Properties
3.45 IAdvTimeScheduleCollection
Properties
Methods
74
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.46 IAdvVenue
Represents a venue object, which can be modified, deleted, and created in HR-
API. Supports the following methods and properties:
Properties
Methods
3.47 IAdvVenueCollection
Properties
Methods
75
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.48 IAdvVenueManager
Methods
76
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
eventsCallback An object implementing the
IAdvAccessPolicyEventsCallback
interface. The SiPass server will call
the OnChange() method on a venue
change
3.49 IAdvVenueBooking
Represents a venue booking, which can be created, modified and deleted using
HR-API
Supports the following properties and methods:
Properties
Owners IAdvEmployees Get a list of employees that are the owners of this
booking
77
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
Methods
3.50 IAdvVenueBookingCollection
Properties
Methods
78
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.51 IAdvVenueBookingManager
Methods
3.52 IAdvWorkgroupManager
Methods
79
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
return
wkgId Workgroup id
80
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.53 AdvWorkgroupType
Value Description
AdvWorkgroupType_Department Department workgroup type
AdvWorkgroupType_Contractor Contractor workgroup type
AdvWorkgroupType_Other Other workgroup type
AdvWorkgroupType_Visitor Visitor workgroup type
3.54 AdvEventType
Enumeration for the possible event types that the server can send the HR-API
application.
Value Description
AdvEventType_Insert, Insert event (new record in database)
AdvEventType_Modify, Modify event (existing property modified in database)
3.55 AdvObjectEventInfo
Structure representing the details of an object event sent from SiPass integrated
server to the HR-API application. Events are only sent if event subscription has
occurred.
These object events are supported for employees, workgroups and venues.
The structure members are as follows:
81
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.56 IAdvObjectEventsCallback
When subscribing to object events, the HR-API application must supply a class
that implements the IAdvObjectEventsCallback interface. The SiPass server will
call this interface‟s OnChange() method when it needs to notify the application of
an event. The OnChange() method must return without exception (returning S_OK)
otherwise the interface will be unsubscribed by the server.
The following are the methods of the interface:
3.57 AdvAccessPolicyEventInfo
Structure representing the details of an access policy event sent from SiPass
integrated server to the HR-API application. Events are only sent if event
subscription has occurred.
These access policy events are supported for employees, workgroups and venues.
Each event shows the addition, deletion, or modification of a single access rule.
The structure members are as follows:
82
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.58 IAdvAccessPolicyEventsCallback
When subscribing to access policy events, the HR-API application must supply a
class that implements the IAdvAccessPolicyEventsCallback interface. The SiPass
server will call this interface‟s OnChange() method when it needs to notify the
application of an event. The OnChange() method must return without exception
(returning S_OK) otherwise the interface will be unsubscribed by the server.
The following are the methods of the interface:
3.59 AdvEmployeeWorkgroupsEventInfo
3.60 IAdvEmployeeWorkgroupsEventsCallback
83
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.61 AdvEmployeeCredential
3.62 AdvEmployeeCredentialEventInfo
84
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.63 IAdvEmployeeCredentialEventsCallback
3.64 AdvFingerIndex
Value
AdvFingerIndex_LeftLittle
AdvFingerIndex_LeftRing
AdvFingerIndex_LeftMiddle
AdvFingerIndex_LeftIndex
AdvFingerIndex_LeftThumb
AdvFingerIndex_RightThumb
AdvFingerIndex_RightIndex
AdvFingerIndex_RightMiddle
AdvFingerIndex_RightRing
AdvFingerIndex_RightLittle
85
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.65 IAdvEmployeeField
Holds the information about a specific employee custom field.
Supports the following read-only properties:
3.66 IAdvEmployeeFields
Represents a collection of IAdvEmployeeField objects.
Supports iteration over the collection of IAdvEmployeeField objects using the
„foreach‟ construct.
Supports the following properties and methods:
Properties:
Methods:
86
Building Technologies A-100084-1
02.2018
Using the SiPass integrated API
3.67 AdvFieldDataType
Enumeration representing the possible data types for an employee custom field
(IAdvEmployeeField)
Value
AdvFieldDataTypeUnknown
AdvFieldDataTypeString
AdvFieldDataTypeDate
AdvFieldDataTypeInteger
AdvFieldDataTypeBoolean
87
Building Technologies A-100084-1
02.2018
HR-API Sample program
The SiPass integrated CD includes a HR-API Sample program. The features of the
HR-API Sample program reflect most of the capabilities of the HR-API.
Feature Overview
Note:
– SiPass integrated must be installed (with „HR API Core‟ feature) on the computers on which you
want to run the sample application
88
Building Technologies A-100084-1
02.2018
Appendix A: Error Codes
The SiPass integrated API methods can generate COM Exceptions containing the
following possible error values during logon:
In addition, the SiPass integrated API methods can generate validation errors of
custom . NET type ValidationException. The validation error codes can be
accessed if the HR-API application has a reference to “SiPass.Exception.dll”
assembly, available in SiPass integrated installation directory.
All possible validation error codes are listed in ErrorCodeEnum (defined in
SiPass.Exception.dll).
89
Building Technologies A-100084-1
02.2018
Appendix A: Error Codes
// System errors
UNKNOWN = 1,
SERVER_INTERNAL = 2,
UNAUTHORISED = 3,
INVALID_LOGIN = 4,
TOO_MANY_WEB_CLIENTS = 5,
ACCESS_DENIED = 6,
90
Building Technologies A-100084-1
02.2018
Appendix A: Error Codes
// Workgroup validation errors
WORKGROUP_DOES_NOT_EXIST = 600,
91
Building Technologies A-100084-1
02.2018
Troubleshooting
6 Troubleshooting
The following troubleshooting table may help you to overcome errors during the
operation of HR-API and SiPass integrated:
Error Solution
HR-API Callback not The COM Security must be configured on the HR-API client
received to receive callback notifications from the server:
On the client computer:
1. Go to Component Services (click Windows+R button
on the keyboard, type dcomcnfg and press Enter)
The Component Services dialog is displayed.
2. Expand the tree - Component Services > Computers
> My Computer
3. Right-click My Computer and select Properties from
the menu options
4. Select the COM Security tab and click Edit Default
5. Add the SiPass server account name and tick the Allow
checkboxes for Local Access and Remote Access
6. Click OK
Note: The baove procedure has been performed on
Microsoft Windows 7 and may vary depending on the
Operating System you are using. Refer to the Help of your
respective operating system in this case.
92
Building Technologies A-100084-1
02.2018
Issued by © Siemens Switzerland Ltd, 2018
Siemens Switzerland Ltd Technical specifications and availability subject to change without notice.
Building Technologies Division
International Headquarters
Gubelstrasse 22
CH-6301 Zug
Tel. +41 41-724 24 24
www.siemens.com/buildingtechnologies