# Liveness API Documentation

## Introduction

The Liveness API provides access to biometric liveness detection results and reporting capabilities. This documentation focuses on two key endpoints: retrieving liveness results and generating reports.

**Important Contact Information:** For information about this API and other solutions in our catalog, please contact our financial area for evaluation at julian@ado-tech.com. All access keys, endpoint URLs, and other access elements will only be provided after reaching a formal agreement between both entities.

## Important Note

The liveness detection process requires integration with components from https://docs.ado-tech.com/books/b-trust/chapter/sdks. These components have associated costs and service agreements that must be discussed with the finance department before implementation.

## API Endpoints

### 1. Get Results

Retrieves the results of a previously executed liveness verification process.

**Endpoint:** `POST {base_url}/api/images/getResults`

**Request Body:**

```json
{
    "idTransaction": "process_id",
    "user": "your_username",
    "password": "your_password",
    "apiKey": "your_api_key",
    "transactionNumber": "process_id"
}

```

**Response:** The API returns detailed liveness verification results, including:

```json
{
    "referenceNumber": "a7112314-f8c6-40b9-a5de-ab91fa98e3bc",
    "score": 0.8818287,
    "quality": 0.8818287,
    "probability": 0.9878632,
    "threshold_probabillity": 0.6,
    "threshold_quality": 0.5,
    "isAlive": true,
    "isFraud": false,
    "image": "/ ",
    "videoBase64": " "
}

```

**Key Response Fields:**

- `referenceNumber`: Unique identifier for the verification result
- `score`: Overall liveness score
- `quality`: Image quality score
- `probability`: Probability that the subject is alive
- `threshold_probabillity`: Minimum probability threshold for positive verification
- `threshold_quality`: Minimum quality threshold for acceptable images
- `isAlive`: Boolean indicating liveness detection result
- `isFraud`: Boolean indicating potential fraud detection
- `image`: Base64 encoded image (abbreviated in example)
- `videoBase64`: Base64 encoded video if applicable (abbreviated in example)

**Note:** The key process liveness ID required for this endpoint is obtained from the B-Trust SDK components. Access to these components requires proper licensing and authorization.

### 2. Generate Report

Generates a comprehensive report of liveness verifications for a specific project and date range.

**Endpoint:** `POST {base_url}/api/images/Report`

**Request Body:**

```json
{
    "IntialDate": "2024-01-01T00:00:00.000Z",
    "EndDate": "2024-02-01T23:59:59.999Z",
    "projectId": "your_project_id"
}

```

**Important Considerations:**

- It is recommended to request reports spanning only 1-2 months at a time for optimal performance
- The `projectId` must match the assigned project identifier from your service agreement
- Date formats must follow ISO 8601 standard (YYYY-MM-DDThh:mm:ss.sssZ)

**Response:** The API will return a comprehensive report of liveness verification transactions within the specified date range for the given project.

## Additional Services

For more advanced biometric verification needs, the following solutions are available:

- **Compare Face**: Validates and compares facial images
- **Validar rostro-persona**: Verifies that a face belongs to a specific person
- **Validar rostro-documento**: Validates a face against identification document photos

These additional services can be integrated with the liveness detection process to create a complete identity verification solution. Each component returns useful data for integration with the liveness verification workflow.

## Service Acquisition

Our catalog contains numerous additional routines and services for biometric verification and identity validation. For more information about all available services, pricing, and implementation:

- Please contact our financial area at: julian@ado-tech.com
- All access elements including API keys, endpoint URLs, and credentials will only be provided after a formal agreement is reached between both entities
- Integration support is available after service contracts are finalized

## Integration Considerations

- Proper error handling is essential for all API calls
- Credentials must be securely stored and transmitted
- Results should be evaluated against your specific security threshold requirements
- Integration with the B-Trust SDK components requires proper licensing and configuration

By leveraging these endpoints, you can access liveness verification results and generate comprehensive reports for your biometric verification processes.