# Velocity Integration restfull sdk

# Install Velocity Web Service

### Requirements

- **Velocity Operator User**: This is required for the IIS application pool.
- **Velocity REST API Software:** Ensure you have the necessary software for the REST API.
- **Velocity REST API User Creation Tool:** This tool is needed to create users for the REST API.
- **Velocity License:** A valid Velocity license is required.  
    
    - SDK2 or RestfulVelocitySDK (SEN 165034): Ensure you have either SDK2 or RestfulVelocitySDK with the specified version.

### Installation

- **Download the Velocity REST API Service Pack**: 
    - Obtain the software pack by contacting Identiv IGS or your SADEVIO account manager.
- **Unzip the Directory**: 
    - Extract the contents of the service pack to your desired location.

[![Screenshot 2024-06-27 at 11.36.00 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-36-00-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-36-00-am.png)

- **Open IIS Manager**: 
    - Launch the Internet Information Services (IIS) Manager.
- **Add a New Website**: 
    - In the left-hand Connections pane, right-click on "Sites" and select "Add Website..."

[![Screenshot 2024-06-27 at 11.38.24 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-38-24-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-38-24-am.png)

- **Site Name**: Enter a name for your site, e.g., `velocityrestapi`.
- **Physical Path**: Select the directory where you have unpacked the Velocity REST API software.
- **TCP Port**: Set your dedicated TCP port, e.g., `8088`.

[![Screenshot 2024-06-27 at 11.39.22 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-39-22-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-39-22-am.png)

**Configure the Application Pool**:

- - **Windows Account**: Ensure the service uses a Windows account that is a Velocity operator with administrative permissions to add/update persons in Velocity.
    - **Select the Application Pool**: 
        - In the left-hand Connections pane, click on "Application Pools."
        - Select your REST API application pool from the list.
    - **Open Advanced Settings**: 
        - - In the right-hand Actions pane, click on "Advanced Settings."

[![Screenshot 2024-06-27 at 11.43.31 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-43-31-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-43-31-am.png)

- In the "Advanced Settings" window, locate the "Identity" option.
- Enter the credentials for your Velocity user.

[![Screenshot 2024-06-27 at 11.44.40 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-44-40-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-44-40-am.png)

8. **Restart the Website**: 
    - After setting the user, restart the website context of the REST API.
9. **Verify the Installation**: 
    - Open a web browser and navigate to the check license endpoint to verify the installation: 
        - `http://localhost:8088/Api/CheckLicense`
    - Ensure everything is functioning correctly.

[![Screenshot 2024-06-27 at 11.47.46 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-47-46-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-47-46-am.png)

### IIS configuration

- **Access Advanced Settings**: 
    - Navigate to your application pool and select "Advanced Settings."
- **Enable 32-Bit Applications**: 
    - Set the "Enable 32-Bit Applications" option to `True`.

[![Screenshot 2024-06-27 at 11.49.51 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-49-51-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-49-51-am.png)

**Configure Idle Time-out**:

- Set the "Idle Time-out (minutes)" option to `0`.

[![Screenshot 2024-06-27 at 11.51.15 AM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-11-51-15-am.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-11-51-15-am.png)

### Generate Velocity REST API Password

- **Generate Password**:
    
    
    - Use the Velocity configuration tool to generate a password for the API.
    - Enter the desired password in both text fields.

[![Screenshot 2024-06-27 at 5.39.21 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/O82screenshot-2024-06-27-at-5-39-21-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/O82screenshot-2024-06-27-at-5-39-21-pm.png)

- **Configure Password**:
    
    
    - **For Cloud Connector**: 
        - Configure the generated password in the `appsettings.json` file.
    - **For On-Premise System**: 
        - Configure the generated password in the access system configuration.

# Sadevio On-Premise configuration

This section will focus on how to configure the SADEVIO system to activate the Velocity integration when running on-premise.

### Configure the access system

- **Create a New Access System**:
    
    
    - Go to **Maintenance**.
    - Select **Access System**.
    - Click on **Create New Access System**.
- **Select Connector Type**:
    
    
    - Choose **Identiv Velocity** as the connector type.
- **Select Time Conversion**:
    
    
    - Choose use local time.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/qYNimage.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/qYNimage.png)

### Configure the Velocity REST API

- **Set REST API URL**:
    
    
    - Enter the IP address and port for the Velocity REST API. e.g. http://192.168.1.61:8088
- **Enter Credentials**:
    
    
    - Provide the password generated with the Velocity configuration tool. See [Generate API Password](http://help.sadevio.com/attachments/5)
- **Configure Card Format**:
    
    
    - Select the card format algorithm you want to use to generate the Velocity MATCH code. Refer to the [Velocity Card Format Mapping](http://help.sadevio.com/attachments/3) section for details.
- **Set Credential Template ID**:
    
    
    - Enter the ID of your generated credential template in Velocity. Refer to the [Configure Velocity Badge Template](http://help.sadevio.com/attachments/2) section for more information.

### Configure User Defined Fields

- **Map SADEVIO Fields to Velocity Fields**:
    
    
    - Under the **User Defined Fields** section in the configuration, you can map SADEVIO fields to the corresponding user-defined fields in Velocity.
- **Populate Velocity Fields**:
    
    
    - The SADEVIO system will automatically populate the mapped information into the appropriate Velocity fields.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/a24image.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/a24image.png)

### Configure Custom Card Data Transformation

In the **UID Post Processor** section, you can add custom JavaScript code to manipulate the actual transferred credential value. This is useful if you need to change the order of a card value or add a facility code in a QR code scenario.

The original value is stored in the variable `cardNumber`. Your code should return a value that represents the new credential value.

#### Example: Adding a Facility Code

The following example checks if the provided UID is 6 characters long. If it is, the code takes the last 5 characters and appends a prefix of `1755-` to the value.

```javascript
if(cardNumber != "" && cardNumber.length == 6 && cardNumber.startsWith('0')){
    var newUid = '1755-'+cardNumber.substr(1);
    return newUid;
}else{
    return cardNumber;
}
```

Place this code in the **UID Post Processor** section to achieve the desired transformation.

# Sadevio Cloud System Connector

To connect your on-premise access control system, you can install the SADEVIO Cloud Connector service. This service facilitates the integration of the SADEVIO Cloud Solution with your access control system.

### Overview

[![Screenshot 2024-06-27 at 2.56.46 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-2-56-46-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-2-56-46-pm.png)

Download the Sadevio Cloud Connector and install it in the same network, where the Velocity Server is.

### Configure Sadevio Cloud System.

- **Create a New Access System**:
    
    
    - Navigate to the **Maintenance** section.
    - Select **Access System**.
    - Click on **Create New Access System**.
- **Set Connector Type**:
    
    
    - Select **Web Socket** as the access system connector type.
    - This action will generate an application ID.
- **Record Application ID**:
    
    
    - Make a note of the generated application ID, as it will be needed for configuring the Cloud Connector.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/image.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/image.png)

### Configure Sadevio Cloud Connector

- **Locate the Configuration File**:
    
    
    - The configuration file for the Sadevio Cloud Connector is named `appsettings.json`.
    - You can find it in the `ProgramData` directory, usually located at `C:\ProgramData\Sadevio`.
- **Open the Configuration File**:
    
    
    - Navigate to the `C:\ProgramData\Sadevio` directory.
    - Open the `appsettings.json` file with a text editor.
- **Activate the Cloud Connector Function**:
    
    
    - In the `appsettings.json` file, ensure that the cloud connector function is activated and the application id set.

[![Screenshot 2024-06-27 at 3.13.03 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-3-13-03-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-3-13-03-pm.png)

### Configure Identiv Velocity features

1. **Locate the Configuration Section**:
    
    
    - In the `appsettings.json` file, find the configuration section for the access system.
2. **Set Access System Type**:
    
    
    - Set the `access_system_type` to `velocity_rest`.
3. **Enter Connection Details**:
    
    
    - Provide the IP address of your Velocity system.
    - Enter the generated password. See [Generate API Password](http://help.sadevio.com/attachments/4)

Example configuration in `appsettings.json`:

[![Screenshot 2024-06-27 at 5.36.27 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-5-36-27-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-5-36-27-pm.png)

#### Configure Velocity Badge Template

- **Open Velocity Client**:
    
    
    - Launch your Velocity Client application.
- **Navigate to Credential Template Configuration**:
    
    
    - Go to **Configuration**.
    - Select **Velocity Configuration**.
    - Click on **Credential Template**.
- **Create a New Credential Template**:
    
    
    - Add the required functions as needed.
    - Press **OK** to save the new credential template.

[![Screenshot 2024-06-27 at 3.19.33 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-3-19-33-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-3-19-33-pm.png)

**Retrieve and Configure Template ID**:

- - Note the template ID of the newly created credential template.
    - Open the `appsettings.json` file.
    - Set the `velocity_rest_template_id` to the template ID. For example, set it to `30`.

[![Screenshot 2024-06-27 at 3.20.30 PM.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/screenshot-2024-06-27-at-3-20-30-pm.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/screenshot-2024-06-27-at-3-20-30-pm.png)

#### Configure Velocity Card Format

The card format configuration is used to determine which algorithm is used to generate the Velocity MATCH Code. Refer to the [Velocity Card Format Mapping](http://help.sadevio.com/attachments/1) section in our documentation for details on the available algorithms.

To use "Special 36" for generating the MATCH CODE, follow these steps:

1. **Locate the Configuration Section**:
    
    
    - In the `appsettings.json` file, find the configuration section for card format.
2. **Set the Card Format**:
    
    
    - Configure the `velocity_rest_card_format` variable to the appropriate value. For "Special 36," set it to `41`.

# Velocity Card Format Mapping

For card creation you need to configure which format velocity has to use. Below you can see the mapping table and which id you need to configure in sadevio.

- STANDARD\_26\_BIT\_WIEGAND = 1
- STANDARD\_27\_BIT\_WIEGAND = 2
- STANDARD\_28\_BIT\_WIEGAND = 3
- STANDARD\_29\_BIT\_WIEGAND = 4
- ONE\_FIELD\_ABA = 5
- SPECIAL\_1 = 6
- SPECIAL\_2 = 7
- SPECIAL\_3 = 8
- SPECIAL\_4 = 9
- SPECIAL\_5 = 10
- SPECIAL\_6 = 11
- SPECIAL\_7 = 12
- SPECIAL\_8 = 13
- SPECIAL\_9 = 14
- SPECIAL\_10 = 15
- SPECIAL\_11 = 16
- SPECIAL\_12 = 17
- SPECIAL\_13 = 18
- SPECIAL\_14 = 19
- SPECIAL\_15 = 20
- SPECIAL\_16 = 21
- SPECIAL\_17 = 22
- SPECIAL\_18 = 23
- SPECIAL\_19 = 24
- SPECIAL\_20 = 25
- SPECIAL\_21 = 26
- SPECIAL\_22 = 27
- SPECIAL\_23 = 28
- SPECIAL\_24 = 29
- SPECIAL\_25 = 30
- SPECIAL\_26 = 31
- SPECIAL\_27 = 32
- SPECIAL\_28 = 33
- SPECIAL\_29 = 34
- SPECIAL\_30 = 35
- PASS\_THRU = 36
- SPECIAL\_32 = 37
- SPECIAL\_33 = 38
- SPECIAL\_34 = 39
- SPECIAL\_35 = 40
- SPECIAL\_36 = 41
- SPECIAL\_37 = 42
- OCTAL\_PASS\_THRU = 43
- SPECIAL\_39 = 44
- SPECIAL\_200\_BIT\_FASCN = 45
- SPECIAL\_200\_BIT = 46
- CFMT\_STD\_WIEGAND\_37E\_PASS = 47
- CFMT\_STD\_WIEGAND\_37NP\_PASS = 48
- SPECIAL\_CUSTOM21 = 100

# Activate QR-Code generation in velocity

This section explains how to configure the QR code transaction for the access control system.

### Configure transfer of qr code to the access control system

To transfer the QR code to the access control system, you need to activate the feature in the access control section.

**Activate QR Code Transfer**:

- - Go to **Maintenance**.
    - Select **Access System**.
    - Choose your specific access system from the list.
    - Activate the feature **Transfer QR-code value**.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/xhtimage.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/xhtimage.png)

### Configure QR code to use quick code value

When using Wiegand to read values with a QR code reader, you may encounter limitations on the length of values a QR code can use. To address this, you can configure SADEVIO to use the quick code as the value for the actual QR code. The range for quick codes can be from `000000` to `999999`. These values are autogenerated but can be limited to a specific range if needed.

1. **Navigate to QR Designer**:
    
    
    - Go to **Maintenance**.
    - Select **System Settings**.
    - Click on **QR Designer**.
2. **Activate Quick Code Usage**:
    
    
    - Select the option **Use Quick-Code as value**.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/ZI1image.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/ZI1image.png)

### Transfer QR Code in Advance

Sometimes it is necessary to transfer the QR code to the access system in advance. For example, when the QR code should function independently of the visitor's check-in status, allowing the user to use the QR code immediately.

The QR code will be valid in the access control system according to the validity period configured for the specific visit.

**Activate Advance QR Code Transfer**:

- - Go to **Maintenance**.
    - Select **Access System**.
    - Choose your specific access system from the list.
    - Enable the feature **Transfer credential in advance**.

[![image.png](http://help.sadevio.com/uploads/images/gallery/2024-06/scaled-1680-/xhtimage.png)](http://help.sadevio.com/uploads/images/gallery/2024-06/xhtimage.png)

# Temporary Card Replacement

Our temporary card replacement feature allows employees to create temporary access cards using the kiosk, for example, if they have forgotten their regular access card. The system will automatically deactivate all active cards in the access system and assign a new temporary card to the employee. Once the temporary card is returned, the system will restore the previous access settings.

A person can only create one temporary card at a time and cannot generate a new card if the previously issued card has not been returned.

### Requirements

- You must have Velocity RESTful API version 1.9.7 or higher.
- The person in Velocity must have an email address specified in one of the UDF (User-Defined Fields).  
    
    - <span style="color: rgb(224, 62, 45);">Each person with an email address can only exist once in the system.</span>

### Configure Sadevio System

#### Dashboard configuration

1. **Navigate to the Access System Configuration**:
    
    
    - Go to **Maintenance**.
    - Select **Access System**.
    - Click on **your selected system**.
2. Go to Temporary Card Replacement under Identiv Velocity Rest Configuration 
    1. Select the **User Defined Field** which will be used to lookup the person with the email address

[![Screenshot 2024-09-20 at 9.26.40 AM.png](https://help.sadevio.com/uploads/images/gallery/2024-09/scaled-1680-/screenshot-2024-09-20-at-9-26-40-am.png)](https://help.sadevio.com/uploads/images/gallery/2024-09/screenshot-2024-09-20-at-9-26-40-am.png)

#### Kiosk configuration

1. **Login to the admin section of the kiosk**:
2. **Activate Application Mode**
    
    
    - Navigate to **Application Mode**.
    - Enable **Temporary Card Replacement**.
    - [![Screenshot_20240920_094245.png](https://help.sadevio.com/uploads/images/gallery/2024-09/scaled-1680-/screenshot-20240920-094245.png)](https://help.sadevio.com/uploads/images/gallery/2024-09/screenshot-20240920-094245.png)
3. **Configure Card-Stacke**r 
    1. Go to **Devices**
    2. Select **CARD STACKER - CARD REPLACEMENT**
4. **Configure Host Authentication**
    1. Go to **Devices**
    2. Select **CARD STACKER - Host-Authentication**
    3. Find the **Authentication Method**
        - Choose the authentication type (we recommend using **Temporary Password**).  
            This option will send a generated temporary code to the person, which they can use to authenticate at the kiosk.
        - [![Screenshot_20240920_094538.png](https://help.sadevio.com/uploads/images/gallery/2024-09/scaled-1680-/screenshot-20240920-094538.png)](https://help.sadevio.com/uploads/images/gallery/2024-09/screenshot-20240920-094538.png)

#### Velocity configuration

Ensure that the person exists in Velocity and that the UDF field you selected for the email lookup is correctly populated.

The velocity data filed need to match the value which you have configure for the sadevio host field Access Card Id