# EMAS eKYC API


# Innov8tif EMAS eKYC APIs Process Flow

Overall Process Flow of eKYC APIs

### eKYC APIs Process Flow Chart

![](/files/-Mb-GX0FW5jO9ul3MiX4)

{% file src="/files/-Mb-GtQHEKitdou2yBnm" %}
Process Flow
{% endfile %}

#### This Flow Chart contains the flow of the APIs:

### **Create JourneyID**&#x20;

The user is required to enter the username and password that will be provided by Innov8tif Solutions upon request for the APIs testing. By obtaining the Journey ID, the user will have the access to all of the APIs that are requested to Innov8tif Solutions so that the user can call each of the APIs.

### **Centralized OkayID**&#x20;

The user will need to provide the input *(input 2 in the flow chart)* to be able to test the API. The main purpose of this API is to perform OCR and extract the data from the ID card. It will output the extracted data out for the user to check on the extracted information.&#x20;

The API will also return cropped ID card from the submitted image and cropped portrait from the ID card.  User will also need to follow a set of rules can be found [here](https://api.innov8tif.com/okayid/image-requirements) to make sure the result is desired.

### **Centralized OkayFace**&#x20;

The user will need to submit a selfie to test on the Centralized OkayFace API. The purpose of this API is to compare the facial image on the ID card with the Selfie taken in this API to check if the user is the same as the ID card's owner.

The API also contains an option to enable the OkayLive API also known as "Liveness Detection" to make sure that the selfie is taken from a real person. This will greatly increase the security level of the OkayFace API to help counter against fake selfie submission. Additional information can be found [here](https://api.innov8tif.com/okaylive/anti-spoofing).

### **Centralized OkayDoc (Non-Passport) - MyKad**

This process is running in the background as explained in the figure above. It will process the input submitted by the user from the Centralized OkayID. The purpose of this API is to perform multiple checkings. The checkings are discussed [here](https://api.innov8tif.com/okaydoc/supported-documents-and-check-type). However, all these checkings only available to MyKad for now.

*A list of check types is listed down below:*

* Font Checking
* Microprint Check
* Photo Substitution Check
* Color Mode
* Hologram
* Screen Detection
* Ghost Photo Color Detection
* ID Blur Detection
* ID Brightness Detection
* Landmark Checking
* Content Substitution (beta)

### **Centralized OkayDoc (Non-Passport) - Non-MyKad**

This process will be running in the background after the launch of the Centralized OkayID API due to the input of Centralized OkayID is the same image. Although the input of OkayID and OkayDoc should be the same, it is not necessary for the document to pass from Centralized OkayID to Centralized OkayDoc.

The purpose of this API is to perform landmark checking, screen detection and more. However, only some of the supported countries that contain the checkings that can find [here](https://api.innov8tif.com/okaydoc/okaydoc-overall).

### **Centralized OkayDoc (Passport)**

The user will need to submit the input *(input 4 in the flow chart)* to be able to test the API. It will process the input submitted by the user. The purpose of this API is to record down the details of each passport for the user.&#x20;

*A list of check types is listed down below:*

* Landmark Checking&#x20;
* Blurriness Detection
* Brightness Detection
* Color Detection
* Screen Detection

The Centralized OkayDoc API also contains Machine-Readable Zone (MRZ) Visual Consistency Check and MRZ Validity for the Passport in OkayDoc. The MRZ code is standard and strictly regulated to comply with the International Civil Aviation Organization. Therefore, the MRZ checks on Centralized OkayDoc will provide assurance on Passport checking. Additional information can be found [here](https://api.innov8tif.com/okaydoc/data-consistency-check/passport-mrz-visual-consistency-check-and-mrz-validity).

{% hint style="info" %}
Please refer to the "[Image Requirement](https://api.innov8tif.com/okaydoc/image-quality-requirements)" section to get the best result for each API return
{% endhint %}

### Guideline for above APIs

{% file src="/files/-Mb-HXgDRwtFzLKp0QgK" %}


# OkayID - Overall

### Page Link

{% content-ref url="/pages/-Luk1eNREII0Ud\_r2TPm" %}
[OCR](/okayid/ocr)
{% endcontent-ref %}

{% content-ref url="/pages/-LpR0P6rotLlwPX7HwBY" %}
[Get Document Type](/okayid/get-document-type)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOGCcjboE3GmxV0g\_O" %}
[Document Type](/okayid/document-type)
{% endcontent-ref %}

{% content-ref url="/pages/-Lti14aBnfJ8uMBPW0qM" %}
[Field Type Reference](/okayid/field-type-reference)
{% endcontent-ref %}

{% content-ref url="/pages/-Lvxx7BWMr\_xJZK\_EDHX" %}
[Passport MRZ-Visual Consistency Check and MRZ Validity](/okaydoc/data-consistency-check/passport-mrz-visual-consistency-check-and-mrz-validity)
{% endcontent-ref %}

{% content-ref url="/pages/-Ltx42cy7555xfJH8wHh" %}
[Error List](/okayid/error-list)
{% endcontent-ref %}

{% content-ref url="/pages/-M-hwtufU717kYgMQi2O" %}
[Image Requirements](/okayid/image-requirements)
{% endcontent-ref %}

### OkayID API Versioning

| Type | Latest Version                                   |
| ---- | ------------------------------------------------ |
| OCR  | <https://api.innov8tif.com/okayid/ocr/version-3> |


# OCR

Supported language: Thai, Chinese, English, Malay

{% content-ref url="/pages/-McCEz2tliuMXxhQoqPk" %}
[Change Log](/okayid/ocr/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-M2mIPbMV7hMevzxOAQB" %}
[Version 3](/okayid/ocr/version-3)
{% endcontent-ref %}

{% content-ref url="/pages/-Luk1cLJJ-bfMXuB3Suc" %}
[Version 2](/okayid/ocr/version-2)
{% endcontent-ref %}

{% content-ref url="/pages/-LpQmEN9CQZWxFGl64lA" %}
[Version 1](/okayid/ocr/version-1)
{% endcontent-ref %}


# Change Log

## Endpoint Version 3

### Core Version 3.0.0.6 - 15/11/2021

**-New Features**

NA

\
-**Bug Fixes**

NA

**-Enhancements**

* Able to extract (\*) in ID number

### Core Version 3.0.0.5 - 15/10/2021

**-New Features**

NA

\
-**Bug Fixes**

NA

**-Enhancements**

* No longer generate auto-filled digit for ic number
* Improved performance and processing time

### Core Version 3.0.0.4

**-New Features**

NA

\
-**Bug Fixes**

NA

**-Enhancements**

* Symbol "?" instead of 0 will be returned for extracted ic number if the digit is not recognized

### Core Version 3.0.0.**3**

**-New Features**

NA

\
-**Bug Fixes**

* Fixed incorrect doctype returned for mykad

**-Enhancements**

* Improved accuracy of extracted information on mykad

### Core Version 3.0.0.**2**

**-New Features**

NA

\
-**Bug Fixes**

NA

**-Enhancements**

* Improved recognition of MyKad - Back.
* Improved performance for Indian ID

### Core Version 3.0.0.1

**-New Features**

NA

\
-**Bug Fixes:**

* Fixed address of MyKad with double line

**-Enhancements**

NA

### Core Version 3.0.0.0

**-New Features:**

* Added 'docTypeEnabled' parameter

\
-**Bug Fixes:**

NA

**-Enhancements**

NA

## Endpoint Version 2

### Core Version 2.0.0.0

**-New Features:**

* Added barcode scanning
* Added 'faceImageEnabled' parameter

\
-**Bug Fixes:**

NA

**-Enhancements**

NA

## Endpoint Version 1

### Core Version 1.0.0.0

* Created base model


# Version 3

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v3/ocr`

#### Request Body

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| docTypeEnabled    | string | Set to True - Document type will be returned.                |
| faceImageEnabled  | string | Set to true - Cropped face image will be returned.           |
| imageEnabled      | string | Set to True - Cropped document image will be returned.       |
| imageFormat       | string | Clarify the image format jpg, jpeg, png, bmp, gif, tiff, tif |
| backImage         | string | Back id card image in base64                                 |
| base64ImageString | string | Front id card/passport image in base64                       |
| apiKey            | string | To be assigned by Innov8tif                                  |

{% tabs %}
{% tab title="200 PageIndex is used to identify whether the base64 string in images array is front.back image.
PageIndex 0 is front; PageIndex 1 is back" %}

```
{
    "status": "success",
    "message": "",
    "images": [
        {
            "Base64ImageString": "/9j/...../9k=",
            "Format": ".jpg",
            "LightIndex": 6,
            "PageIndex": 0
        },
        {
            "Base64ImageString": "/9j/....../Z",
            "Format": ".jpg",
            "LightIndex": 6,
            "PageIndex": 1
        }
    ],
    "result": [
        {
            "ListVerifiedFields": {
                "pFieldMaps": [
                    {
                        "wLCID": 0,
                        "FieldType": 1,
                        "wFieldType": 1,
                        "Field_MRZ": null,
                        "Field_Visual": "MYS",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 2,
                        "wFieldType": 2,
                        "Field_MRZ": null,
                        "Field_Visual": "861200556488",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 1086,
                        "FieldType": 71172108,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "PEREMPUAN",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 12,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "F",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 17,
                        "wFieldType": 17,
                        "Field_MRZ": null,
                        "Field_Visual": "NO 22 JATAN BB 3/3^NANDAR RUDIT PUCHONG^47000 PUCHONG^SELANGOR",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 25,
                        "wFieldType": 25,
                        "Field_MRZ": null,
                        "Field_Visual": "LIEW HEY LEE",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 38,
                        "wFieldType": 38,
                        "Field_MRZ": null,
                        "Field_Visual": "Malaysia",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 57,
                        "wFieldType": 57,
                        "Field_MRZ": null,
                        "Field_Visual": "8612005564880202",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 433,
                        "wFieldType": 433,
                        "Field_MRZ": null,
                        "Field_Visual": "WARGANEGARA",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    }
                ]
            }
        }
    ],
    "faceImages": "/9j/.......//Z",
    "documentType": "Malaysia - Id Card #2"
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON " %}

```
{
    "base64ImageString": "/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "backImage":"/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "apiKey":"API_KEY",               
    "imageFormat":".jpg",
    "imageEnabled":true,
    "faceImageEnabled": true,
    "docTypeEnabled":true
}
```

{% endcode %}

{% file src="/files/-M2mK2A6BFz\_c8qPKgbV" %}
OkayID v3
{% endfile %}


# Version 2

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v2/ocr`

#### Request Body

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| faceImageEnabled  | string | Set to true - Cropped face image will be returned            |
| imageEnabled      | string | Set to True - Cropped document image will be returned        |
| imageFormat       | string | Clarify the image format jpg, jpeg, png, bmp, gif, tiff, tif |
| backImage         | string | Back id card image in base64                                 |
| base64ImageString | string | Front id card/passport image in base64                       |
| apiKey            | string | To be assigned by Innov8tif                                  |

{% tabs %}
{% tab title="200 PageIndex is used to identify whether the base64 string in images array is front/back image.
PageIndex 0 is front; PageIndex 1 is back." %}

```
{
    "status": "success",
    "message": "",
    "images": [
        {
            "Base64ImageString": "/9j/4AA...",
            "Format": null,
            "LightIndex": 6,
            "PageIndex": 1
        },
        {
            "Base64ImageString": "/9j/4AA...",
            "Format": null,
            "LightIndex": 6,
            "PageIndex": 0
        }
    ],
    "result": [
        {
            "ListVerifiedFields": {
                "pFieldMaps": [
                    {
                        "wLCID": 0,
                        "FieldType": 1,
                        "wFieldType": 1,
                        "Field_MRZ": null,
                        "Field_Visual": "MYS",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 2,
                        "wFieldType": 2,
                        "Field_MRZ": null,
                        "Field_Visual": "000000000000",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 5,
                        "wFieldType": 5,
                        "Field_MRZ": null,
                        "Field_Visual": "11/26/0000",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 1086,
                        "FieldType": 71172108,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "LELAKI",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 12,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "M",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 17,
                        "wFieldType": 17,
                        "Field_MRZ": null,
                        "Field_Visual": "00. SUBANG JAYA^47620 SUBANG JAYA^SELANGOR",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 25,
                        "wFieldType": 25,
                        "Field_MRZ": null,
                        "Field_Visual": "XX XXXX",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 38,
                        "wFieldType": 38,
                        "Field_MRZ": null,
                        "Field_Visual": "Malaysia",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 57,
                        "wFieldType": 57,
                        "Field_MRZ": null,
                        "Field_Visual": "00000000000000",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 168,
                        "wFieldType": 168,
                        "Field_MRZ": null,
                        "Field_Visual": "00000000",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 185,
                        "wFieldType": 185,
                        "Field_MRZ": null,
                        "Field_Visual": "24",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 433,
                        "wFieldType": 433,
                        "Field_MRZ": null,
                        "Field_Visual": "WARGANEGARA",
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    }
                ]
            }
        }
    ],
    "faceImages": "/9j/4AAQ..."
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON " %}

```
{
    "base64ImageString": "/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "backImage":"/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "apiKey":"API_KEY",               
    "imageFormat":".jpg",
    "imageEnabled":true,
    "faceImageEnabled": true
}
```

{% endcode %}

{% file src="/files/-LzB2jjmMAmQoWqSolqW" %}
OkayID v2
{% endfile %}


# Version 1

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v1/ocr`

#### Request Body

| Name              | Type    | Description                                                                        |
| ----------------- | ------- | ---------------------------------------------------------------------------------- |
| apiKey            | string  | To be assigned by Innov8tif                                                        |
| base64ImageString | string  | Front id card/passport image in base64                                             |
| backImage         | string  | Back id card image in base64                                                       |
| imageFormat       | string  | Clarify the image format: jpg, jpeg, png, bmp, gif, tiff, tif                      |
| imageEnabled      | boolean | <p>True - Cropped image will be returned<br>False - No image will be returned </p> |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "message": "",
    "result": [
        {
            "ListVerifiedFields": {
                "pFieldMaps": [
                    {
                        "wLCID": 0,
                        "FieldType": 0,
                        "wFieldType": 0,
                        "Field_MRZ": "P",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 1,
                        "wFieldType": 1,
                        "Field_MRZ": "PAK",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 2,
                        "wFieldType": 2,
                        "Field_MRZ": "BJ9152173",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 3,
                        "wFieldType": 3,
                        "Field_MRZ": "3/6/2023",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 4,
                        "wFieldType": 4,
                        "Field_MRZ": null,
                        "Field_Visual": "3/7/2018",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 5,
                        "wFieldType": 5,
                        "Field_MRZ": "1/16/1985",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 6,
                        "wFieldType": 6,
                        "Field_MRZ": null,
                        "Field_Visual": "KARACHI, PAK",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 7,
                        "wFieldType": 7,
                        "Field_MRZ": "4220179672171",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 8,
                        "wFieldType": 8,
                        "Field_MRZ": "REHMAN",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 9,
                        "wFieldType": 9,
                        "Field_MRZ": "FAHAD",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 11,
                        "wFieldType": 11,
                        "Field_MRZ": null,
                        "Field_Visual": "PAKISTANI",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 12,
                        "wFieldType": 12,
                        "Field_MRZ": "M",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 24,
                        "wFieldType": 24,
                        "Field_MRZ": null,
                        "Field_Visual": "PAKISTAN",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 25,
                        "wFieldType": 25,
                        "Field_MRZ": "REHMAN FAHAD",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 26,
                        "wFieldType": 26,
                        "Field_MRZ": "PAK",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 36,
                        "wFieldType": 36,
                        "Field_MRZ": "4220179672171",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 38,
                        "wFieldType": 38,
                        "Field_MRZ": "Pakistan",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 51,
                        "wFieldType": 51,
                        "Field_MRZ": "P<PAKREHMAN<<FAHAD<<<<<<<<<<<<<<<<<<<<<<<<<<^BJ91521738PAK8501167M23030604220179672171<54",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 80,
                        "wFieldType": 80,
                        "Field_MRZ": "8",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 81,
                        "wFieldType": 81,
                        "Field_MRZ": "7",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 82,
                        "wFieldType": 82,
                        "Field_MRZ": "0",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 84,
                        "wFieldType": 84,
                        "Field_MRZ": "4",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 129,
                        "wFieldType": 129,
                        "Field_MRZ": null,
                        "Field_Visual": "KHALID REHMAN",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 164,
                        "wFieldType": 164,
                        "Field_MRZ": null,
                        "Field_Visual": "71201075793",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 165,
                        "wFieldType": 165,
                        "Field_MRZ": null,
                        "Field_Visual": "F0351095",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 172,
                        "wFieldType": 172,
                        "Field_MRZ": "P<PAKREHMAN<<FAHAD<<<<<<<<<<<<<<<<<<<<<<<<<<^BJ91521738PAK8501167M23030604220179672171<54",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 185,
                        "wFieldType": 185,
                        "Field_MRZ": "35",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 195,
                        "wFieldType": 195,
                        "Field_MRZ": "5",
                        "Field_Visual": null,
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 364,
                        "wFieldType": 364,
                        "Field_MRZ": "33",
                        "Field_Visual": null,
                        "Matrix": null
                    }
                ]
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON " %}

```
{
    "base64ImageString": "/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "backImage":"/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "apiKey":"API_KEY",               
    "imageFormat":".jpg",
    "imageEnabled":true
}
```

{% endcode %}

{% file src="/files/-Ly7TrCBIapsI0bWkcxQ" %}
OkayID v1
{% endfile %}

##


# Get Document Type

## Get Document Type

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v1/ocr/documenttype`

#### Request Body

| Name              | Type    | Description                            |
| ----------------- | ------- | -------------------------------------- |
| base64ImageString | string  | Front id card/passport image in base64 |
| backImage         | string  | Back id card/passport image in base64  |
| apiKey            | string  | To be assigned by Innov8tif            |
| imageFormat       | string  |                                        |
| imageEnabled      | boolean |                                        |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "message": "success",
    "document_type": "Malaysia - Id Card #2" 
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
    "base64ImageString": "/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "backImage":"/9j/4AAQSkZJRgAB...wEwJefc\r\nf//Z\r\n",
    "apiKey":"API_KEY",               
    "imageFormat":".jpg",
    "imageEnabled":true
}
```

{% endcode %}

{% file src="/files/-Ltx77Q3UKKscGBG962V" %}
OkayID-GetDocumentType
{% endfile %}


# Document Type

{% content-ref url="/pages/-LvOIlmultw1kSpuHD3D" %}
[Brunei](/okayid/document-type/brunei)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOJGSuq2LFw\_hjOJ-e" %}
[Cambodia](/okayid/document-type/cambodia)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOO1j7mo6PxXkcMnU8" %}
[Indonesia](/okayid/document-type/indonesia)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOHOAYAKZnR7ZGMtAB" %}
[Malaysia](/okayid/document-type/malaysia)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOI5SYDsNDir\_seuID" %}
[Myanmar](/okayid/document-type/myanmar)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOJVjn6IizPLsGorhk" %}
[Philippines](/okayid/document-type/philippines)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOHUaQz75nBhbGI5SY" %}
[Singapore](/okayid/document-type/singapore)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOIXQnNoytVeKA2y2h" %}
[Thailand](/okayid/document-type/thailand)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOJtgdNPl5-6FRZEil" %}
[United Arab Emirates](/okayid/document-type/united-arab-emirates)
{% endcontent-ref %}

{% content-ref url="/pages/-LvOIJFoZpqz04CRu-K7" %}
[Vietnam](/okayid/document-type/vietnam)
{% endcontent-ref %}


# Brunei

| Document Type   | Document Name                          | Remark                                                                |
| --------------- | -------------------------------------- | --------------------------------------------------------------------- |
| Domestic IC     | Brunei Darussalam - Id Card #2         |                                                                       |
| Permanent IC    | Brunei Darussalam - Id Card #2         |                                                                       |
| Driving License | Brunei Darussalam - Driving License #1 |                                                                       |
| Passport        | Brunei Darussalam - ePassport (2008)   | Document name might be different, depending on document issuing date. |


# Cambodia

| Document Type | Document Name           | Remark                                                                |
| ------------- | ----------------------- | --------------------------------------------------------------------- |
| New IC        | Cambodia - Id Card #3   |                                                                       |
| Old IC        | Cambodia - Id Card #2   |                                                                       |
| Passport      | Cambodia - ePassport #3 | Document name might be different, depending on document issuing date. |


# Indonesia

| Document Type | Document Name           | Remark                                                                |
| ------------- | ----------------------- | --------------------------------------------------------------------- |
| IC            | Indonesia - Id Card #2  |                                                                       |
| Passport      | Indonesia - Passport #9 | Document name might be different, depending on document issuing date. |


# Malaysia

| Document Type   | Document Type in OCR                    | Remark                                                                |
| --------------- | --------------------------------------- | --------------------------------------------------------------------- |
| New IC          | Malaysia - Id Card #2                   |                                                                       |
| Old IC          | Malaysia - Id Card #1                   |                                                                       |
| Driving License | Malaysia - Driving License #4           |                                                                       |
| MyPR            | Malaysia - Permanent Resident Card #1   |                                                                       |
| MyKas           | Malaysia - Id Card #6                   |                                                                       |
| MyTentera       | Malaysia - Armed Forces Id Card #1      |                                                                       |
| MyPolis         | Malaysia - Police Card #1               |                                                                       |
| MyKid           | Malaysia - Child Id Card #1             |                                                                       |
| Visa            | Malaysia - Visa #10                     |                                                                       |
| iKAD            | Malaysia - Temporary Employment Card #1 |                                                                       |
| Passport        | Malaysia - ePassport(2017)              | Document name might be different, depending on document issuing date. |


# Myanmar

| Document Type   | Document Name                | Remark                                                                |
| --------------- | ---------------------------- | --------------------------------------------------------------------- |
| Driving License | Myanmar - Driving License #1 |                                                                       |
| Passport        | Myanmar - Passport #2        | Document name might be different, depending on document issuing date. |


# Philippines

| Document Type       | Document Name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Remark                                                                |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| PRC                 | Philippines - Professional Id Card #1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                       |
| Old Driving License | <p>Philippines - Driving License #1</p><p></p><p>Philippines - Driving License #2</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                       |
| New Driving License | <p>Philippines - Driving License (2017) #1<br></p><p>Philippines - Driving License (2017) #2</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                       |
| SSS                 | Philippines - Social Security Card #1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                       |
| UMID                | <p>Philippines - UMID Card #1</p><p></p><p>Philippines - UMID Card #2</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                       |
| Voter ID            | <p>Philippines - Voting Card #1<br></p><p>Philippines - Voting Card #2</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                       |
| Postal ID           | <p>Philippines - Postal Id Card #1<br></p><p>Philippines - Postal Id Card #2</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                       |
| Passport            | <p>Philippines - ePassport (2016)</p><p></p><p>Philippines - ePassport (2016) Diplomatic</p><p></p><p>Philippines - ePassport (2016) Service</p><p></p><p>Philippines - ePassport #4</p><p></p><p>Philippines - ePassport #5<br><br>Philippines - ePassport #4 Diplomatic</p><p></p><p>Philippines - ePassport #5 Diplomatic<br><br>Philippines - ePassport #4 Service</p><p></p><p>Philippines - ePassport #5 Service</p><p></p><p>Philippines - Passport #1</p><p></p><p>Philippines - Passport #2</p><p></p><p>Philippines - Passport #3<br></p><p></p><p></p> | Document name might be different, depending on document issuing date. |


# Singapore

| Document Type      | Document Name                               | Remark                                                                                                                                                                                             |
| ------------------ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NRIC(Citizen & PR) | Singapore - Id Card  #1, #3, #4, #5, #6, #7 | <p>To determine if a document is a PR/Citizen NRIC,</p><p>kindly check the 'Place of Birth' field in OCR. <br>If it is 'SINGAPORE', the document should be Citizen NRIC, else it is a PR NRIC.</p> |
| Dependant Pass     | Singapore - Id Card #2                      |                                                                                                                                                                                                    |
| Visit Pass         | Singapore - Id Card #2                      |                                                                                                                                                                                                    |
| Student Pass       | Singapore - Id Card #2                      |                                                                                                                                                                                                    |
| Employment Pass    | Singapore - Employment Pass #1              |                                                                                                                                                                                                    |
| S Pass             | Singapore - S Pass #1                       |                                                                                                                                                                                                    |
| Work Permit        | Singapore - Work Permit #1                  |                                                                                                                                                                                                    |
| Driving License    | Singapore - Driving License #1              |                                                                                                                                                                                                    |
| Passport           | Singapore - ePassport(2006)                 | Document name might be different, depending on document issuing date.                                                                                                                              |


# Thailand

| Document Type | Document Name           | Remark                                                                |
| ------------- | ----------------------- | --------------------------------------------------------------------- |
| IC            | Thailand - Id Card #1   |                                                                       |
| Passport      | Thailand - ePassport #5 | Document name might be different, depending on document issuing date. |


# United Arab Emirates

| Document Type   | Document Name                                        | Remark                                                                   |
| --------------- | ---------------------------------------------------- | ------------------------------------------------------------------------ |
| IC              | United Arab Emirates - Id Card #2                    |                                                                          |
| Driving License | United Arab Emirates - Driving License Sharjah(1990) | Document name might be different, depending on document issuing country. |
| Passport        | United Arab Emirates - ePassport(2011)               | Document name might be different, depending on document issuing date.    |


# Vietnam

| Document Type | Document Name            | Remark                                                                |
| ------------- | ------------------------ | --------------------------------------------------------------------- |
| New IC        | Vietnam - Id Card #4     |                                                                       |
| Old IC        | Vietnam - Id Card #1     |                                                                       |
| Passport      | Vietnam - Passport(2005) | Document name might be different, depending on document issuing date. |


# Field Type Reference


# FieldType List

wFieldType -  A standard code value that define field.

FieldType - If the code value returned is different with the one returned in wFieldType. It indicates that the FieldVisual is returned in a language other than English.

{% file src="/files/-MJ6NUyoY-fdMeGP0Alg" %}


# Brunei

## Identity Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Place of Birth          | 6          | 6         |
| Personal Number         | 7          | 7         |
| Sex                     | 12         | 138280972 |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 185       |


# Cambodia

## Identity Card

| Field                               | wFieldType | FieldType |
| ----------------------------------- | ---------- | --------- |
| Document Class Code                 | 0          | 0         |
| Issuing State Code                  | 1          | 1         |
| Document Number                     | 2          | 2         |
| Date of Expiry                      | 3          | 3         |
| Date of Birth                       | 5          | 5         |
| Surname                             | 8          | 8         |
| Given Names                         | 9          | 9         |
| Nationality                         | 11         | 11        |
| Sex                                 | 12         | 12        |
| Surname And Given Names             | 25         | 25        |
| Nationality Code                    | 26         | 26        |
| MRZ Type                            | 35         | 35        |
| Issuing State Name                  | 38         | 38        |
| MRZ Strings                         | 51         | 51        |
| Document Number Check Digit         | 80         | 80        |
| Date of Birth Check Digit           | 81         | 81        |
| Date of Expiry Check Digit          | 82         | 82        |
| Final Check Digit                   | 84         | 84        |
| MRZ Strings With Correct Check Sums | 172        | 172       |
| Age                                 | 185        | 185       |
| Remainder Term                      | 364        | 364       |


# Indonesia

## Identity Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Place of Birth          | 6          | 6         |
| Sex                     | 12         | 69271564  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Address Area            | 64         | 64        |
| Address City            | 77         | 77        |
| Marital Status          | 160        | 160       |
| Blood Group             | 180        | 180       |
| Address Location        | 189        | 189       |
| Profession              | 312        | 312       |
| Religion                | 363        | 363       |
| Remainder Term          | 364        | 364       |


# Malaysia

## Old MyKad

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Sex                     | 12         | 71172108  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Old IC Number           | 27         | 27        |
| Issuing State Name      | 38         | 38        |
| RegCert RegNumber       | 57         | 57        |
| Age                     | 185        | 185       |
| Civil Status            | 433        | 433       |
| Religion                | 363        | 363       |

## New MyKad

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Sex                     | 12         | 71172108  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| RegCert RegNumber       | 57         | 57        |
| Serial Number           | 168        | 168       |
| Age                     | 185        | 185       |
| Civil Status            | 433        | 433       |
| Religion                | 363        | 363       |

## MyPR

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Nationality             | 11         | 11        |
| Sex                     | 12         | 71172108  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 185       |
| Religion                | 363        | 363       |

## MyKas

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Sex                     | 12         | 71172108  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 185       |
| Religion                | 363        | 363       |
| Remainder Term          | 364        | 364       |
| Civil Status            | 433        | 433       |

## MyTentera

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Sex                     | 12         | 71172108  |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| RegCert RegNumber       | 57         | 57        |
| Age                     | 185        | 185       |
| Religion                | 363        | 363       |
| Civil Status            | 433        | 433       |

## MyPolis

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 185       |
| Reference Number        | 193        | 193       |
| Profession              | 312        | 312       |

## MyKid

| Field                    | wFieldType | FieldType |
| ------------------------ | ---------- | --------- |
| Issuing State Code       | 1          | 1         |
| Document Number          | 2          | 2         |
| Date of Birth            | 5          | 5         |
| Nationality              | 11         | 11        |
| Sex                      | 12         | 71172108  |
| Sex                      | 12         | 12        |
| Address                  | 17         | 17        |
| Surname And Given Names  | 25         | 25        |
| Issuing State Name       | 38         | 38        |
| RegCert RegNumber        | 57         | 57        |
| Age                      | 185        | 185       |
| Place Of Birth (Country) | 263        | 263       |
| Religion                 | 363        | 363       |

## Visa

| Field                        | wFieldType | FieldType |
| ---------------------------- | ---------- | --------- |
| Issuing State Code           | 1          | 1         |
| Date of Expiry               | 3          | 3         |
| Date of Issue                | 4          | 4         |
| Date of Birth                | 5          | 5         |
| Nationality                  | 11         | 11        |
| Sex                          | 12         | 12        |
| Surname And Given Names      | 25         | 25        |
| Nationality Code             | 26         | 26        |
| Passport Number              | 27         | 27        |
| MRZ Type                     | 35         | 35        |
| Issuing State Name           | 38         | 38        |
| Place of Issue               | 39         | 39        |
| MRZ String                   | 51         | 51        |
| RegCert RegNumber            | 57         | 57        |
| Date of Birth Check Digit    | 81         | 81        |
| Date of Expiry Check Digit   | 82         | 82        |
| Passport Number Check Digit  | 85         | 85        |
| Visa Valid Until Check Digit | 89         | 89        |
| Visa Valid Until             | 102        | 102       |
| Age                          | 185        | 185       |
| Visa Number                  | 196        | 196       |
| Remainder Term               | 364        | 364       |
| Years Since Issue            | 523        | 523       |

## iKAD

|                         |            |           |
| ----------------------- | ---------- | --------- |
| Field                   | wFieldType | FieldType |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 18        |
| Section                 | 190        | 190       |
| Address Country         | 256        | 256       |
| Organization            | 276        | 276       |
| Remainder Term          | 364        | 364       |


# Myanmar

## Driving License

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Personal Number         | 7          | 7         |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Blood Group             | 180        | 180       |
| Age                     | 185        | 185       |


# Philippines

## PRC Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Surname                 | 8          | 8         |
| Given Names             | 9          | 9         |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Document Number         | 57         | 57        |
| Date of Registration    | 70         | 70        |
| Age                     | 185        | 185       |
| Remainder Term          | 364        | 364       |

## SSS Card

| Field                   | wFieldtype | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 19         | 19        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |

## UMID Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Surname                 | 8          | 8         |
| Given Names             | 9          | 9         |
| Sex                     | 12         | 12        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Middle Name             | 146        | 146       |
| Age                     | 185        | 185       |

## Driving License

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Surname                 | 8          | 8         |
| Given Names             | 9          | 9         |
| Nationality             | 11         | 11        |
| Sex                     | 12         | 12        |
| Height                  | 13         | 13        |
| Weight                  | 14         | 14        |
| Eyes Color              | 15         | 15        |
| DL Restriction Code     | 22         | 22        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Blood Group             | 180        | 180       |
| Age                     | 185        | 185       |
| Conditions              | 287        | 287       |
| AGY                     | 351        | 351       |
| Remainder Term          | 364        | 364       |

## Voter ID

| Field                   | wFieldtype | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Date of Birth           | 5          | 5         |
| Nationality             | 11         | 11        |
| Address                 | 17         | 17        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| VIN CheckDigit          | 148        | 148       |
| Age                     | 185        | 185       |
| Civil  Status           | 433        | 433       |
| Precinct                | 450        | 450       |

## Postal ID

| Field                   | wFieldtype | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Nationality             | 11         | 11        |
| Address                 | 17         | 17        |
| Authority               | 24         | 24        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Serial  Number          | 168        | 168       |
| Age                     | 185        | 185       |
| Remainder Term          | 364        | 364       |


# Singapore

## Identity Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Birth           | 5          | 5         |
| Place of Birth          | 6          | 6         |
| Sex                     | 12         | 12        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Barcode                 | 50         | 50        |
| Race Ethnicity          | 122        | 122       |
| Age                     | 185        | 185       |


# Thailand

## Identity Card

| Field                         | wFieldType | FieldType |
| ----------------------------- | ---------- | --------- |
| Issuing State Code            | 1          | 1         |
| Document Number               | 2          | 2         |
| Date of Expiry                | 3          | 3         |
| Date of Issue                 | 4          | 4         |
| Date of Birth                 | 5          | 5         |
| Surname                       | 8          | 8         |
| Given Names                   | 9          | 9         |
| Address(Thai)                 | 17         | 69074961  |
| Surname And Given Names       | 25         | 25        |
| Surname And Given Names(Thai) | 25         | 69074969  |
| Issuing State Name            | 38         | 38        |
| Laser Code (Back ID)          | 142        | 142       |
| Age                           | 185        | 185       |
| Remainder Term                | 364        | 364       |


# United Arab Emirates

## Identity Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Nationality             | 11         | 11        |
| Surname And Given Names | 25         | 25        |
| Issuing State Name      | 38         | 38        |
| Document Number         | 142        | 14        |


# Vietnam

## Identity Card

| Field                   | wFieldType | FieldType |
| ----------------------- | ---------- | --------- |
| Issuing State Code      | 1          | 1         |
| Document Number         | 2          | 2         |
| Date of Expiry          | 3          | 3         |
| Date of Birth           | 5          | 5         |
| Place of Birth          | 6          | 69861382  |
| Nationality             | 11         | 69861387  |
| Sex                     | 12         | 69861388  |
| Sex                     | 12         | 12        |
| Address                 | 17         | 69861393  |
| Surname And Given Names | 25         | 69861401  |
| Issuing State Name      | 38         | 38        |
| Age                     | 185        | 185       |
| Remainder Term          | 364        | 364       |


# Passport

| Field                             | wFieldType | FieldType |
| --------------------------------- | ---------- | --------- |
| Document Class Code               | 0          | 0         |
| Issuing State Code                | 1          | 1         |
| Document Number                   | 2          | 2         |
| Date of Expiry                    | 3          | 3         |
| Date of Issue                     | 4          | 4         |
| Date of Birth                     | 5          | 5         |
| Place of Birth                    | 6          | 6         |
| Personal Number                   | 7          | 7         |
| Nationality                       | 11         | 11        |
| Sex                               | 12         | 12        |
| Height                            | 13         | 13        |
| Authority                         | 24         | 24        |
| Surname And Given Names           | 25         | 25        |
| Nationality Code                  | 26         | 26        |
| MRZ Type                          | 35         | 35        |
| MRZ Name                          | 36         | 36        |
| Issuing State Name                | 38         | 38        |
| MRZ String                        | 51         | 51        |
| Document Number Check Digit       | 80         | 80        |
| Date of Birth Check Digit         | 81         | 81        |
| Date of Expiry Check Digit        | 82         | 82        |
| Final Check Digit                 | 84         | 84        |
| Middle Name                       | 146        | 146       |
| MRZ Strings with Correct Checksum | 172        | 172       |
| Age                               | 185        | 185       |
| Optional Data Check Digit         | 195        | 195       |
| Remainder Term                    | 364        | 364       |


# Error List

### General

{% code title="API key expired" %}

```
{
    "status": "error",
    "message": "API_KEY_EXPIRED",
    "result": null
}
```

{% endcode %}

{% code title="Maximum API call hit" %}

```
{
    "status": "error",
    "message": "MAX_API_CALL_EXCEEDED",
    "result": null
}
```

{% endcode %}

### OCR

{% code title="Missing/Wrong apiKey" %}

```
{
    "status": "error",
    "message": "INVALID_API_KEY",
    "result": null
}
```

{% endcode %}

{% code title="Missing base64ImageString" %}

```
{
    "status": "error",
    "message": "Error in status.",
    "result": null
}
```

{% endcode %}

{% code title="Invalid image" %}

```
{
    "status": "success",
    "message": "",
    "images": [
        {
            "Base64ImageString": "xxxxxxxxxx",
            "Format": ".jpg",
            "LightIndex": 6,
            "PageIndex": 0
        }
    ],
    "result": null
}
```

{% endcode %}

{% code title="Request size more than 5MB" %}

```
{
    "status": "error",
    "message": "Request size exceed 5MB.",
    "result": null
}
```

{% endcode %}

{% code title="No parameter sent" %}

```
{
    "status": "error",
    "statusMessage": "Error in processing."
}
```

{% endcode %}

{% code title="Image not recognized by the system" %}

```
{
    "status": "error",
    "message": "UNRECOGNIZED_IMAGE"
}
```

{% endcode %}

{% code title="Missing ID Number will be filled with "?"" %}

```
{
    "wLCID": 0,
    "FieldType": 2,
    "wFieldType": 2,
    "Field_MRZ": null,
    "Field_Visual": "88888801????",
    "Field_Barcode": null,
},
```

{% endcode %}

### Get Document Type

{% code title="Missing/Wrong apiKey" %}

```
{
    "status": "error",
    "message": "INVALID_API_KEY",
    "document_type": null
}
```

{% endcode %}

{% code title="Missing base64ImageString/Invalid image" %}

```
{
    "status": "error",
    "message": null,
    "document_type": null
}
```

{% endcode %}

{% code title="No parameter is sent" %}

```
{
    "status": "error",
    "statusMessage": "Error in processing."
}
```

{% endcode %}


# Image Requirements

## Requirements For Images

* Document should be fully inside the image;
* Document should take 70 - 80% of the image area;
* Document should not be stuck to image edges;
* Image should be in focus in the document area;
* There should be no glares or significant shadow on the document;
* The background should be as contrast as possible, avoid capturing white on white, and dark on dark;
* Resolution should be at least 200 PPI (300 PPI is recommended) for correct OCR (for ID1 86x54 mm taking \~80% of the image area, image size should be at least 900x600);
* Supported formats are: JPG, JPEG, PNG, BMP, GIF, TIFF, TIF
* Max Request Size: 20mb

## Image Quality Requirements

Below are the requirements for size and quality of document images captured by any device, which are necessary for successful image processing by OkayID:

* **Good lighting**

  Good lighting helps to achieve better results. If the image is too dark or too bright, the document can not be processed.

![](/files/-M-htxwn871quhC3a_8J)

* **Avoid reflections**

  Glares and reflections interfere with processing and reduce data extraction accuracy. We recommend **not to use** the flash of your mobile device when capturing document images.

![](/files/-M-hu7OqrcgXZMVpAKyF)

* **Focus and sharpness**

  Make sure the image is clear and there are no blurred areas.

![](/files/-M-huCZz969firczHaje)

* **Angle**

  The tilt angle of the document should not exceed 10 degrees in any direction (horizontal or vertical).

![](/files/-M-huIX3BrEwdKwVKiiU)

* **Margins (too small)**

  Make sure there is minimal space around the document. It is recommended that the document takes up 70-80% of the image.

![](/files/-M-huOfVIUyE_yh3X1ma)

* **Margins (too big)**

  Make sure the space around the document does not take up more than 20-30% of the image. It is recommended that the document takes up 70-80% of the image.

![](/files/-M-huVDEzTPGJpdTBML5)

* **Contrast**

  The document should be in clear contrast to the background. A light-colored document on a light background, as well as a dark-colored document on a dark background, cannot be recognized.

![](/files/-M-hudd6EPhKeQaSsbRV)

* **Resolution of the image**

  To achieve a good quality of recognition of identification documents, we recommend that you provide images captured by a camera with a resolution of at least Full HD (1920×1080) and autofocus.

![](/files/-M-nGI5q0ctc4UhTfW6M)

* **Extraneous objects**

  Make sure your hands or other objects do not cover document data.

![](/files/-M-hujof-X7sesUpKMfp)


# Indonesia

## Change Log

### Version 1

* Created base model


# Version 1

Supported documents: eKTP

## eKTP

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/innov-ocr/v1`

#### Request Body

| Name        | Type   | Description                                                                                       |
| ----------- | ------ | ------------------------------------------------------------------------------------------------- |
| apiKey      | string | To be assigned by Innov8tif                                                                       |
| imageBase64 | string | Image in base64 encoded string                                                                    |
| imageFile   | object | <p>Image file.<br>(If both imageBase64 and imageFile are provided, imageBase64 will be used.)</p> |
| docType     | string | <p>Document type:<br>          indonesia\_ektp<br>            <br>      </p>                      |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "listFieldMaps": [
        {
            "fieldType": "address",
            "fieldValue": " JL. KR. JOHAR BARU UTARA E-2/2 "
        },
        {
            "fieldType": "dob",
            "fieldValue": "  JAKARTA 11-10 1981"
        },
        {
            "fieldType": "name",
            "fieldValue": " ENDAH IRAWAN"
        },
        {
            "fieldType": "id",
            "fieldValue": " xxxxxxxxxxxxxxxx"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

![](/files/-M7L3a4QbvYV4L5_6WAS)

{% file src="/files/-M7AeQawzJo1SMaqOOR7" %}
OkayID Lite
{% endfile %}


# Malaysia

## Change Log

### Version 1

* Created base model


# Version 1

Supported documents: MyKad front, MyKad back, MyKas, MyPR, MyTentera, Passport

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v4/ocr`

#### Request Body

| Name              | Type    | Description                                                   |
| ----------------- | ------- | ------------------------------------------------------------- |
| backImage         | string  | Back id card image in base64                                  |
| docTypeEnabled    | boolean | Set True to return document type                              |
| apiKey            | string  | To be assigned by Innov8tif                                   |
| base64ImageString | string  | id card/passport image in base64                              |
| imageFormat       | string  | Clarify the image format: jpg, jpeg, png, bmp, gif, tiff, tif |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "message": "",
    "result": [
        {
            "ListVerifiedFields": {
                "pFieldMaps": [
                    {
                        "wLCID": 0,
                        "FieldType": 17,
                        "wFieldType": 17,
                        "Field_MRZ": null,
                        "Field_Visual": "NO 22 JATAN BB 3/3^NANDAR RUDIT PUCHONG^47000 PUCHONG^SELANGOR",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 71172108,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "UNKNOWN",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 433,
                        "wFieldType": 433,
                        "Field_MRZ": null,
                        "Field_Visual": "WARGANEGARA",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 25,
                        "wFieldType": 25,
                        "Field_MRZ": null,
                        "Field_Visual": "LIEW HEY LEE",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 2,
                        "wFieldType": 2,
                        "Field_MRZ": null,
                        "Field_Visual": "861200556488",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 363,
                        "wFieldType": 363,
                        "Field_MRZ": null,
                        "Field_Visual": "OTHER",
                        "Matrix": null
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 57,
                        "wFieldType": 57,
                        "Field_MRZ": null,
                        "Field_Visual": "861200-55-6488-02-02",
                        "Matrix": null
                    }
                ]
            }
        }
    ],
    "documentType": null
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON " %}

```
{
    "base64ImageString": "/9j/4QaMRXh",
    "backImage": "/9j/4QaMRXh",
    "apiKey":"{{apiKey}}",               
    "imageFormat":".jpg",
    "docTypeEnabled":true
}
```

{% endcode %}

{% file src="/files/-MSjmKdTtWr1xX3aCbAD" %}


# Thailand


# Version 1

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/v1/th-ocr`

#### Request Body

| Name              | Type   | Description                                    |
| ----------------- | ------ | ---------------------------------------------- |
| apiKey            | string | To be assigned by Innov8tif                    |
| base64ImageString | string | Front ID card image in base64 encrypted string |
| backImage         | string | Back ID card image in base64 encrypted string  |
| faceImageEnabled  | string | Set to True. Return cropped id face image      |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "message": "successfully performed OCR ",
    "front_detection_score": 0.836729072034359,
    "address": "ฒนามสกุล ดี. เณฑ๒",
    "en_dob": "11 Apr. 1979",
    "en_expire": "11 Apr. 2018",
    "en_fname": "Natta",
    "en_init": "Miss",
    "en_issue": "11 Mar. 2009",
    "en_lname": "Chaichua",
    "face": "/9j/4AAQSkZJ.......",
    "id_number": "3123300144131",
    "religion": "",
    "th_dob": "ฒนามสกุล น ด",
    "th_expire": "11 เม.ย. 2558",
    "th_fname": "",
    "th_init": "",
    "th_issue": "11 มี.ค. 2552",
    "th_lname": "",
    "back_detection_score": 0.9875280658404033,
    "back_number": "-"
}
```

{% endtab %}
{% endtabs %}

### Input Example

```
{
    "base64ImageString": "/9j/4AAQS......",
    "backImage":"/9j/4AAQ.......",
    "apiKey":"apikey",               
    "faceImageEnabled":true
}
```

{% file src="/files/-MRU7HfYT7FdKeU\_9h6l" %}


# OCR(Non-Roman Character)

## Change Log

### Version 1

* Created base model


# Version 1

Supported documents: Cambodia ID, Japan Driving License, Japan Residence Card

## Cambodia ID, Japan Driving License, Japan Residence Card

<mark style="color:green;">`POST`</mark> `https://okayiddemo.innov8tif.com/okayid/api/innov-ocr/v1`

#### Request Body

| Name        | Type   | Description                                                                                                                      |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| apiKey      | string | To be assigned by Innov8tif                                                                                                      |
| imageBase64 | string | Image in base64 encoded string                                                                                                   |
| imageFile   | object | <p>Image file.<br>(If both imageBase64 and imageFile are provided, imageBase64 will be used.)</p>                                |
| docType     | string | <p>Document type:<br>          cambodia\_id,<br>          japan\_drivinglicense,<br>          japan\_residencecard<br>      </p> |

{% tabs %}
{% tab title="200 Cambodia ID's response" %}

```
{
    "status": "success",
    "listFieldMaps": [
        {
            "fieldType": "pob",
            "fieldValue": "- ឃុំពេជសារ ស្រុកកោះអណ្តែត តាកែវ"
        },
        {
            "fieldType": "gender",
            "fieldValue": "empty"
        },
        {
            "fieldType": "address2",
            "fieldValue": "Sឃុំពេជសារ ស្រុកកោះអណ្តែត តាកែវ"
        },
        {
            "fieldType": "dob",
            "fieldValue": "empty"
        },
        {
            "fieldType": "address1",
            "fieldValue": "ភូមិព្រៃធំ"
        },
        {
            "fieldType": "name",
            "fieldValue": "empty"
        },
        {
            "fieldType": "remark",
            "fieldValue": "សំលាកតូចចំ 0,៥សម ក្រោយក្រោមចុងចិញ្ចើមឆ្វេង'"
        },
        {
            "fieldType": "validity",
            "fieldValue": "empty"
        },
        {
            "fieldType": "b'id",
            "fieldValue": "empty"
        },
        {
            "fieldType": "height",
            "fieldValue": "១៧៥ ស.ម"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
For cambodia ID,  OCR for ID number, name, date of birth, gender, and validity are not available at this moment.
{% endhint %}

### Input Example

![](/files/-M5KKa0DhLPCSux8qh5b)

{% file src="/files/-M7AeUAMe49QE0Jdu0Mg" %}
OkayID Lite
{% endfile %}


# Image Requirements

Image Requirements for OkayID Lite

## Requirements for Images

Below are the requirements for size and quality of document images captured by any device, which are necessary for successful image processing by OkayID Lite:

* Document should be fully inside the image;
* Document should take 70 - 80% of the image area;
* Document should not be stuck to image edges;
* Image should be in focus in the document area;
* There should be no glares or significant shadow on the document;
* The background should be as contrast as possible, avoid capturing white on white, and dark on dark;
* Good lighting helps to achieve better results. If the image is too dark or too bright, the document can not be processed.
* **Image Resolution:**
  * **Maximum: 3000 x 1500**
  * **Minimum: 1343 x 847 (Cropped ID Image);**
* Max File Size: 3MB

{% hint style="warning" %}
Having the image not meeting the requirements will reduce the accuracy of the OkayID Lite.
{% endhint %}

## Image Quality Requirements

Below are the requirements for size and quality of document images captured by any device, which are necessary for successful image processing by OkayID Lite:

* **Good lighting**

  Good lighting helps to achieve better results. If the image is too dark or too bright, the document can not be processed.

![](/files/-M-htxwn871quhC3a_8J)

* **Avoid reflections**

  Glares and reflections interfere with processing and reduce data extraction accuracy. We recommend **not to use** the flash of your mobile device when capturing document images.

![](/files/-M-hu7OqrcgXZMVpAKyF)

* **Focus and sharpness**

  Make sure the image is clear and there are no blurred areas.

![](/files/-M-huCZz969firczHaje)

* **Angle**

  The tilt angle of the document should not exceed 10 degrees in any direction (horizontal or vertical).

![](/files/-M-huIX3BrEwdKwVKiiU)

* **Margins (too small)**

  Make sure there is minimal space around the document. It is recommended that the document takes up 70-80% of the image.

![](/files/-M-huOfVIUyE_yh3X1ma)

* **Margins (too big)**

  Make sure the space around the document does not take up more than 20-30% of the image. It is recommended that the document takes up 70-80% of the image.

![](/files/-M-huVDEzTPGJpdTBML5)

* **Contrast**

  The document should be in clear contrast to the background. A light-colored document on a light background, as well as a dark-colored document on a dark background, cannot be recognized.

![](/files/-M-hudd6EPhKeQaSsbRV)

* **Resolution of the image**

  To achieve a good quality of recognition of identification documents, we recommend that you provide images captured by a camera with a resolution of at least Full HD (1920×1080) and autofocus.

![](/files/-M-nGI5q0ctc4UhTfW6M)

* **Extraneous objects**

  Make sure your hands or other objects do not cover document data.

![](/files/-M-hujof-X7sesUpKMfp)


# Getting Started with OkayID Lite

This page briefly describes and contains the information needed about OkayID Lite mobile SDK

## OkayID Lite

OkayID Lite is a mobile SDK to ease the user by performing ID card OCR extraction. OkayID Lite contains the function of performing OCR scanning that is similar to OkayCam but using video to make sure that it captures all of the information needed in the ID card. It also contains cropping functionality to crop the portrait face contains on the ID card.

This OkayID Lite mobile SDK is developed into three different platforms which are Android, iOS and React-native that contain the same functionalities.

## Requirements

#### Android

* Android SDK 21 and above

#### iOS

* Swift 5+
* iOS 11.0 and above (arm64 architecture)

{% hint style="warning" %}
The SDK only supports the minimum requirement and above for Android and iOS
{% endhint %}


# Installation Guide

This page contains the installation guide needed for OkayID Lite in Android, iOS and React-native

{% tabs %}
{% tab title="Android" %}

### Android Installation Guide

The first step of the installation for OkayID Lite in Android is to include the following dependencies in the project-level build.gradle file. The build.gradle file will need to make some changes as follow below:

```
allprojects {
    repositories {
        ...
        mavenCentral()
    }
}
```

Include the following dependencies in the app-level build.gradle file as shown below:

```
dependencies {
    implementation 'com.innov8tif.okayidlite:OkayIDLite:1.0.2'
}
```

After adding the code, sync the project with gradle files to make sure all of the dependencies is successfully installed.
{% endtab %}

{% tab title="iOS" %}

### iOS Installation Guide

OkayID Lite is available through the [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html). The first step of the installation for OkayID Lite in iOS is to simply add the following line of code to your app target as shown below:

```
use_frameworks!
pod 'OkayIDLite', '1.0.10'

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "CryptoSwift"
            puts "Enable module stability for CryptoSwift"
            target.build_configurations.each do |config|
                config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
            end
        end
    end
end
```

After adding the code above to the Podfiles:

* Run the command "pod install" to install the dependency.
* Add "NSCameraUsageDescription" to the info.plist in order to gain camera permissions
  {% endtab %}

{% tab title="React-native" %}

### React-native Installation Guide

In React-native, the first step of the installation is to install the react-native OkayIDLite into the environment using the command below:

```
$ react-native install react-native-okayid-lite
```

#### For iOS in React-native:

Navigate to the iOS folder and add the following code to the Podfiles:

```
platform :ios, '11.0'
use_frameworks!

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "CryptoSwift"
			        puts "Enable module stability for CryptoSwift"
			        target.build_configurations.each do |config|
				            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' 
				    end
        end
    end
end
```

After adding the code above to the Podfiles:

* Run the command "pod install" to install the dependency
* Add "NSCameraUsageDescription" to the info.plist in order to gain camera permissions
* Add `${PODS_ROOT}/GoogleMLKit/MLKitCore/Sources` to Pod Project Header Search Path

![](/files/-M_-h5PFK6KevbHVTrtW)

* Add "NSCameraUsageDescription" to the info.plist in order to gain camera permissions

## Issues

#### iOS:

1. There will be several issues stated in the quote below:

> Undefined symbol: \_*swift\_FORCE\_LOAD*$\_swiftUniformTypeIdentifiers
>
> Undefined symbol: \_*swift\_FORCE\_LOAD*$\_swiftCoreMIDI

If users encountered the errors above, it can be solved by creating a new swift file called **Void.swift** without adding a **bridging header**.

![](/files/-M_-hLCCV2iAvlcx49A-)

## License

After that, a license key is required for both Android and iOS by adding the code below:

```
const license = Platform.select({
    android: "",
    ios: ""
})
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Please be aware of the codes and commands above are **case sensitive**
{% endhint %}


# Development

This page contains the information on Usage, Configuration, Result of OkayID Lite in Android, iOS and React-native

{% tabs %}
{% tab title="Android" %}

### Usage

For Android, a valid license key is required to start the process.

{% code title="Java" %}

```java
Config config = new Config.Builder()
                .setExtractAddress(true)
                .setExtractGender(true)
                .setExtractReligion(true)
                .build();

OkayLiteActivity.startMyKadScanning(this, LICENSE_KEY, config, new OkayLiteResultListener() {
    @Override
    public void onResultReceived(boolean isSuccess, int errorCode, MyKadResult result) {
        Logger.d("result => " + result);
        if (isSuccess) {
            //do something with success result
        } else {
            //do something with error
        }
    }
});


```

{% endcode %}

{% code title="Kotlin" %}

```kotlin
//By default it is true
val config = Config.Builder()
    .setExtractAddress(false)
    .setExtractReligion(false)
    .setExtractGender(false)
    .build()
        
OkayLiteActivity.startMyKadScanning(this, LICENSE_KEY,config,
{ isSuccess, errorCode, result ->
    if (isSuccess) {
        //do something with success result
    } else {
        //do something with error
    }
})
```

{% endcode %}

{% hint style="info" %}
The configurations by default are set as "true"
{% endhint %}

### Result

These are the explanation of the results that the OkayID Lite will be returning as follow:

| Property         | Description                                                                        |
| ---------------- | ---------------------------------------------------------------------------------- |
| fullName         | Full name                                                                          |
| icNumber         | IC number                                                                          |
| gender           | Gender                                                                             |
| dob              | Date of Birth                                                                      |
| religion         | Religion                                                                           |
| address          | Full address                                                                       |
| fullDocumentPath | <p>Path to the full document image captured </p><p>during the scanning process</p> |

### Error Code&#x20;

These are the error code that will be raised after each of the scanned is done.

| Error Code   | Constant Name                            | Description                                                                            |
| ------------ | ---------------------------------------- | -------------------------------------------------------------------------------------- |
| -1           | MyKadResult.NO\_ERROR                    | MyKad has been successfully scanned                                                    |
| 1            | MyKadResult.ERROR\_INVALID\_LICENSE\_KEY | The license is invalid                                                                 |
| 2            | MyKadResult.ERROR\_PERMISSION\_DENIED    | The user does not grant permission to access the camera and storage in order to do OCR |
| 3            | MyKadResult.ERROR\_USER\_CANCEL\_ACTION  | The user cancels during the scanning process (eg. user press back button)              |
| {% endtab %} |                                          |                                                                                        |

{% tab title="iOS" %}

### Usage

For iOS, there are a few steps that needed to be followed as below:

* Then, import "**OkayIDLite"** module into the swift file.

```
import OkayIDLite
```

* After that, build the configuration object as follow:

```
let config = Config.Builder()
    .setExtractAddress(true) // Toggle address extraction
    .setExtractGender(true) // Toggle gender extraction
    .setExtractReligion(true) // Toggle religion extraction
    .build()
```

* Then, start the process by calling "startMyKadScanning" on the **OkayIDLite** class with the config object. It is also a must to pass a valid license string and a reference to the view controller. The "self" is referring to the current view controller in the example below:

```
OkayIDLiteSDK.startMyKadScanning(
    viewController: self,
    license: lic,
    config: config
)
{ success, errorCode, result in
    if(success) {
        // handle success
    } else {
        // handle error
    }
}
```

Code above is an example to handle the success or failure of the MyKad scanning that the action can be customized by the user.

{% hint style="info" %}
If it is not successful, the result will be returning nil
{% endhint %}

### Result

These are the explanation of the results that the OkayID Lite will be returning as follow:

| Property         | Description                                                                        |
| ---------------- | ---------------------------------------------------------------------------------- |
| fullName         | Full name                                                                          |
| icNumber         | IC number                                                                          |
| gender           | Gender                                                                             |
| dob              | Date of Birth                                                                      |
| religion         | Religion                                                                           |
| address          | Full address                                                                       |
| fullDocumentPath | <p>Path to the full document image captured </p><p>during the scanning process</p> |

### Error Code&#x20;

These are the error code that will be raised after each of the scanned is done.

| Error Code   | Constant Name                                  | Description                                                              |
| ------------ | ---------------------------------------------- | ------------------------------------------------------------------------ |
| -1           | MyKadResult.NO\_ERROR                          | MyKad has been successfully scanned                                      |
| 1            | MyKadResult.ERROR\_INVALID\_LICENSE\_KEY       | The license is invalid                                                   |
| 2            | MyKadResult.ERROR\_PERMISSION\_DENIED          | The use did not grant permission to access the camera in order to do OCR |
| 3            | MyKadResult.ERROR\_USER\_CANCEL\_ACTION        | The user cancelled during the scanning process                           |
| 4            | MyKadResult.ERROR\_UNSUPPORTED\_CAMERA\_PRESET | The device's camera does not support the required preset for video OCR   |
| {% endtab %} |                                                |                                                                          |

{% tab title="React-native" %}

### Usage

For React-native, this is an example for the document capture for the custom camera UI design as following:&#x20;

```
import RNOkayidLite from "react-native-okayid-lite"

//By default it is true
RNOkayidLite.startMykadScanning({
    license: license,
    extractAddress: false,
    extractGender: false,
    extractReligion: false
})
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.log(error)
    })

```

### Configuration

There are some configurations object to be followed in the development stage. The configurations that are going to show below can be implemented into the **Usage** section above.

### Result

| Property          | Description                                                          |
| ----------------- | -------------------------------------------------------------------- |
| fullName          | Full name                                                            |
| icNumber          | IC number                                                            |
| gender            | Gender                                                               |
| dob               | Date of birth                                                        |
| religion          | Religion                                                             |
| address           | Full address                                                         |
| fullDocumentImage | Path to the full document image captured during the scanning process |

### Error Code

| Error                                    | Description                                                               |
| ---------------------------------------- | ------------------------------------------------------------------------- |
| invalid license                          | The license is invalid                                                    |
| permission denied                        | The user did not grant permission to access the camera in order to do OCR |
| cancel                                   | The user cancelled during the scanning process                            |
| failed                                   | Unexpected error                                                          |
| unsupported camera preset **(iOS Only)** | The device's camera does not support the required preset for video OCR.   |
| {% endtab %}                             |                                                                           |
| {% endtabs %}                            |                                                                           |


# Changelog

This page shows the changes being made in the OkayID Lite - Mobile SDK

## Version 1.0 (5-May-2021)

### Added

* OkayID Lite for Mobile SDK is released (Android)
* OkayID Lite for Mobile SDK is released (iOS)
* OkayID Lite for Mobile SDK is released (React-native)


# Anti-spoofing

<mark style="color:green;">`POST`</mark> `https://okayliveplusdemo.innov8tif.com/pd/api/liveness_spoof/checking`

Request to be submitted in form-data

#### Request Body

| Name                                     | Type   | Description             |
| ---------------------------------------- | ------ | ----------------------- |
| data<mark style="color:red;">\*</mark>   | File   | Selfie Image            |
| apiKey<mark style="color:red;">\*</mark> | String | XXXXXXXXXXXXXXXXXXXXXXX |

{% tabs %}
{% tab title="200: OK JSON Responses (Live Selfie)" %}

```javascript
{
    "status": "success",
    "message": "api.success",
    "score": 0.6890439391136169,
    "class": "Live" 
}
```

{% endtab %}

{% tab title="200: OK JSON Responses (non-live selfie)" %}

```javascript
{
    "status": "success",
    "message": "api.success",
    "score": 0.2694315016269684,
    "class": "Spoof" 
}
```

{% endtab %}
{% endtabs %}

### Example Input Parameter (form-data)

![](/files/FWQUFqcY7LIIqogUV8Rl)

## Error Messages

### Face Not Found

```
{
    "status": "error",
    "message": "FACE_NOT_FOUND" 
}
```

### Empty result or error in parsing the python result

```
{
    "status": "error",
    "message": "Error in processing" 
}
```


# Anti-spoofing

{% content-ref url="/pages/-McCJBM2hEP39L0g4n0D" %}
[Change Log](/okaylive/anti-spoofing/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-LpRYTnhqnsnPZJwa6UP" %}
[Version 1](/okaylive/anti-spoofing/version-1)
{% endcontent-ref %}


# Change Log

## Endpoint Version 1

### Core Version 1.0.0.3 - 30/9/2021

**-New Features:**

NA

**-Bug Fixes:**

NA

-**Enhancements:**

* Improved overall accuracy

### Core Version 1.0.0.2

**-New Features:**

NA

**-Bug Fixes:**

NA

-**Enhancements:**

* Improved overall accuracy

### Core Version 1.0.0.1

**-New Features:**

NA

**-Bug Fixes:**

NA

-**Enhancements:**

* Improved accuracy for people wearing hijab

### Core Version 1.0.0.0

* Created base model


# Version 1

<mark style="color:green;">`POST`</mark> `https://okaylivefacedemo.innov8tif.com/api/check_liveness`

#### Request Body

| Name   | Type   | Description                                     |
| ------ | ------ | ----------------------------------------------- |
| apiKey | string | To be assigned by Innov8tif                     |
| data   | object | The binary image data uploaded as a file        |
| Meta   | string | The JSON string with device information         |
| X-Meta | string | The JSON string with any additional information |

{% tabs %}
{% tab title="200 " %}

```
{    
    "probability": 0.99,    
    "score": 9.0,    
    "quality": 1.0 
}, 
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
"Meta" parameter is not required but it can significantly decrease overall error rate. The current version of API supports mobile OS setting.
{% endhint %}

{% file src="/files/-Ltx8bH2itwpwfdCi2Qc" %}
OkayLive-AntiSpoofing
{% endfile %}

| Meta Key    | Meta Value                    | Required |
| ----------- | ----------------------------- | -------- |
| OS          | "IOS", "ANDROID" or "UNKNOWN" | True     |
| MANUFACTURE | "UNKNOWN"                     | False    |
| MODEL       | "UNKNOWN"                     | False    |

> If you're not sure about the device meta, please set 'UNKNOWN' value or just not to pass 'Meta' in the header.

### Interpretation of Result

| Key         | Value                                                                                                                                      |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| probability | Probability of liveness                                                                                                                    |
| score       | <p>Linear liveness score: bigger value means more alive,</p><p><strong>(not suggested as a threshold to detect the liveness.)</strong></p> |
| quality     | Quality value, **(not suggested to be used for decision making.)**                                                                         |
| error       | Error message from the server                                                                                                              |

{% hint style="danger" %}
The response of  "**score**" and "**quality**" is NOT suggested to be used for the decision making for detection result.
{% endhint %}

* Probability of liveness is a main response of the system.
* &#x20;The image is accepted as "live" when a ***probability*** is ***bigger*** than ***0.5***.
* &#x20;Linear liveness score can be used for BPCER / APCER tuning. The range of **score** is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Probability can be ***lower*** than ***0.5*** by the reasons below.
  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.

> We highly advise to analyze quality value and reject inappropriate images.

OK response data is always in JSON format. If you received code 200, your data has been accepted, however, there can be one of the following error messages:

| Message                        | Description                                                       |
| ------------------------------ | ----------------------------------------------------------------- |
| Failed to decode image         | Image format is not supported.                                    |
| Can't read image from bytes    | File is corrupted.                                                |
| Failed while detecting face    | Face detection module failed during processing of image.          |
| Failed to detect face          | Face detector can't find faces.                                   |
| Failed while predict landmarks | Facial landmarks cannot be found.                                 |
| Failed to convert image        | Internal error. Please send raw data to developers for debugging. |
| Failed to predict result       | Internal error. Please send raw data to developers for debugging. |
| Failed to crop face            | Face is too close to camera.                                      |
| Face image is too small        | Face width or height is under 224 pixels.                         |

Error message also comes with with error code.

| Error                          | Description                                                                                                                          |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| FACE\_TOO\_CLOSE               | A distance between face and camera is too small for preprocessing issues                                                             |
| FACE\_CLOSE\_TO\_BORDER        | Face is too close to one or more borders. May reduce the accuracy of spoofing detection because edges of face may not be seen        |
| FACE\_CROPPED                  | Face is cropped. May reduce the accuracy of spoofing detection because edges of face may not be seen                                 |
| FACE\_IS\_OCCLUDED             | There is occlusion on the face or it is difficult to see face, which degrades the quality of liveness                                |
| FACE\_NOT\_FOUND               | Face detector can't find face on image                                                                                               |
| TOO\_MANY\_FACES               | Face detector found more than one face on image                                                                                      |
| FACE\_TOO\_SMALL               | Facial area is not big enough for analysis. Either interpupillary distance(80px) or face size(224 px) is below the configured value. |
| FACE\_ANGLE\_TOO\_LARGE        | Facial out-of-plane rotation angle is extremely large                                                                                |
| FAILED\_TO\_PREDICT\_LANDMARKS | Landmarks prediction error                                                                                                           |
| UNKNOWN                        | Unhandled exception in the code                                                                                                      |

### Image Requirements

Originally, anti-spoofing methods have been developed on smartphone database, which consists of 720p and 1080p horizontally and vertically oriented selfies, taken without any additional post-compressioning. Photo capturing mode result in an increase of True Liveness Rate because it relies less on blur effects.

* Recommended height: 720 or 1080.
* Minimal supported height: 480.
* No image compression is highly recommended: JPEG 70 level as low as practicable.
* Minimum image size(width/height): 450px
* Vertical Orientation

It’s recommended to use uncompressed formats. If it’s not possible, then it’s recommended to compress image with the highest quality. The difference between near compression levels is invisible to the naked eye but very significant for the anti-spoofing methods retina.

### Face Requirements

* Out-of-plane rotation angle: from -20±3 to 20±3 degrees.
* In-plane rotation angle: from -30±3 to 30±3 degrees.
* Minimal distance between the eyes of the subject: 80 px.
* Minimal face size is 224 pixels in any dimension.
* Sun glasses can be confusing.

### Capture Requirements

* Motion blur effect can significantly increase BPCER.
* Fish-eye lenses are not supported by this API.
* Texture filtering can significantly increase APCER.
* Spot lights on the faces and nearest surroundings can significantly increase BPCER.
* Ill-lighted environment and colored light can significantly increase BPCER.
* Rectangular-shaped object in background can significantly increase BPCER.

#### Correct Sample

![](/files/-MTd-IIR75dXf9h9P_n9)

![](/files/-MTd-RaAagQGeUPuDIjY)

![](/files/-MTd0IFej3eT5vdMiGo3)

#### Incorrect Sample

![Motion Blur](/files/-MTd5s_e63abj89keVPB)

![Spotlight](/files/-MTd5l4-xioa4SSAjaN6)

![FACE\_TOO\_CLOSE](/files/-MYwa13qMeC3OalABnQf)

![FACE\_CLOSE\_TO\_BORDER](/files/-MYwa9nQR-aCkIF5yeOu)

![FACE\_CROPPED](/files/-MYwaekZEF14HyjV_LgU)

![FACE\_NOT\_FOUND](/files/-MYwalilGUbyg8o1qeL2)

![FACE\_TOO\_SMALL](/files/-MYwaI_ZrICOgvQLvrz7)

![TOO\_MANY\_FACES](/files/-MYwatNg3kv9xVYbxle-)

![FACE\_IS\_OCCLUDED](/files/-MZAnGzTvgrgGYZFUeEF)

![FACE\_ANGLE\_TOO\_LARGE](/files/-MTd6RcPDoC6Lqjtfw5d)

### Capture module

Capturing images and pictures correctly with the mobile device camera is an important element of anti-spoofing detection routine.

#### Mobile Web

There are two general approaches in Web API to capture a single frame:

| **Source**   | Pros                       | Cons                                      | Compatibility | Sample Code                                        |
| ------------ | -------------------------- | ----------------------------------------- | ------------- | -------------------------------------------------- |
| File API     | Available from any browser | Camera mode control not guaranteed        | Low           | -                                                  |
| getUserMedia | Camera mode control        | The list of supported browsers is limited | High          | [github](https://github.com/IDRnD/Capture-Samples) |


# OkayFace - Overall

### Page Link

{% content-ref url="/pages/-LpR161cfNDSqder1bau" %}
[1:1 Face Verification V2](/okayface/1-1-face-verification-v2)
{% endcontent-ref %}

{% content-ref url="/pages/-LpRCFYLLprOwOdsYfX\_" %}
[1:1 Face Verification V3](/okayface/1-1-face-verification-v3)
{% endcontent-ref %}

{% content-ref url="/pages/-Lvj6BYtAm-nTA6020lx" %}
[1:1 Face Verification V4](/okayface/1-1-face-verification-v4)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPMvEIjcOZWJyXgURs" %}
[1:1 Face Verification V2-1](/okayface/1-1-face-verification-v2-1)
{% endcontent-ref %}

{% content-ref url="/pages/-M-TAm660Fsa1BcO7ko6" %}
[1:1 Face Verification V2-2](/okayface/1-1-face-verification-v2-2)
{% endcontent-ref %}

{% content-ref url="/pages/-LpREnYuDUsdVkTYC-Vg" %}
[1:1 Face Verification V3-1](/okayface/1-1-face-verification-v3-1)
{% endcontent-ref %}

{% content-ref url="/pages/-Lvj7ujEG2Zwp2sb0DoQ" %}
[1:1 Face Verification V4-1](/okayface/1-1-face-verification-v4-1)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPaeLYxHWZxPMXyk7N" %}
[Error List](/okayface/error-list)
{% endcontent-ref %}

{% content-ref url="/pages/-MRxySZhiC5S8dVxx23B" %}
[Image Requirements](/okayface/image-requirements)
{% endcontent-ref %}


# Face Verification


# Version 1

## Insert Face Into Database

<mark style="color:green;">`POST`</mark> `http://okaydocdev.innov8tif.com/ekyc/api/innov-face/facequery/insert`

#### Request Body

| Name        | Type   | Description                                                                                                          |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| userName    | string | Image name.                                                                                                          |
| groupName   | string | Image group name.                                                                                                    |
| imageFile   | object | Image object. Either use imageBase64 or imageFile, if both are filled in, baseBase64 will be used.                   |
| imageBase64 | string | Image in base64 encoded string. Either use imageBase64 or imageFile, if both are filled in, baseBase64 will be used. |
| apiKey      | string | To be assigned by Innov8tif.                                                                                         |

{% tabs %}
{% tab title="200 groupStatus indicates group existence in the database. (EXISTING/NEW)" %}

```
{
    "status": "success",
    "groupName": "celebrity",
    "groupStatus": "EXISTING",
    "name": "tom"
}
```

{% endtab %}
{% endtabs %}

### Example Input&#x20;

![](/files/-M5doUkdgHBgj1k2Anqh)

## Match Faces In Database

<mark style="color:green;">`POST`</mark> `http://okaydocdev.innov8tif.com/ekyc/api/innov-face/query`

#### Request Body

| Name        | Type   | Description                                                                                                          |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| groupName   | string | Image group to be matched with.                                                                                      |
| imageFile   | object | Image object. Either use imageBase64 or imageFile, if both are filled in, baseBase64 will be used.                   |
| imageBase64 | string | Image in base64 encoded string. Either use imageBase64 or imageFile, if both are filled in, baseBase64 will be used. |
| apiKey      | string | To be assigned by Innov8tif.                                                                                         |

{% tabs %}
{% tab title="200 Image was found in the group" %}

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "tom",
    "score": 1.0
}
```

{% endtab %}

{% tab title="302 Group exists but cannot find similar face" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": true
}
```

{% endtab %}

{% tab title="304 Group does not exist." %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": false
}
```

{% endtab %}
{% endtabs %}

### Example Input

![](/files/-M5duEOBKo6o0-cXIpg_)

{% file src="/files/-M5dudSCaOVVs7-f7Y9K" %}
Face Verification
{% endfile %}


# 1:1 Face Verification V2

## 1:1 Face Verification V2

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v2/verify`

#### Request Body

| Name         | Type   | Description                                   |
| ------------ | ------ | --------------------------------------------- |
| apiKey       | string | To be assigned by Innov8tif                   |
| imageIdCard  | object | Front id card image                           |
| imageBest    | object | Image that's used to compare with imageIdCard |

{% tabs %}
{% tab title="200 Response without liveness checking" %}

```
{
    "request_id": "1491401591,b0398182-ca04-4f7e-b59a-7c83398cf230",
    "result_idcard": {
        "confidence": 96.46025
    }
}
```

{% endtab %}
{% endtabs %}

### Input Example in Postman

![](/files/-M0LGnFEYT110H5IvqSB)

{% file src="/files/-Ltx9ROOQ6QLGvJS0hfa" %}
OkayFace v2
{% endfile %}

### Recommended Threshold :75

| Face Verification Status | Description                               |
| ------------------------ | ----------------------------------------- |
| Pass                     | Confidence Score >= Recommended Threshold |
| Fail                     | Confidence Score < Recommended Threshold  |


# Change Log

## Endpoint Version 2

### Core Version 2.0.0.0

* Created base model


# 1:1 Face Verification V3

## 1:1 Face Verification V3

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v3/verify`

#### Request Body

| Name         | Type   | Description                                                   |
| ------------ | ------ | ------------------------------------------------------------- |
| apiKey       | string | To be assigned by Innov8tif                                   |
| imageIdCard  | object | Front id card image                                           |
| imageBest    | string | Encrypted string for liveness face retrieved via liveness SDK |

{% tabs %}
{% tab title="200 Response without liveness checking" %}

```
{
    "request_id": "1491401591,b0398182-ca04-4f7e-b59a-7c83398cf230",
    "result_idcard": {
        "confidence": 96.46025
    }
}
```

{% endtab %}
{% endtabs %}

{% file src="/files/-Ltx9yNSsyV1dyMkEX6B" %}
OkayFace v3
{% endfile %}

### Recommended Threshold: 75

| Face Verification Status | Description                               |
| ------------------------ | ----------------------------------------- |
| Pass                     | Confidence Score >= Recommended Threshold |
| Fail                     | Confidence Score < Recommended Threshold  |


# Change Log

## Endpoint Version 3

### Core Version 3.0.0.0

* Created base model


# 1:1 Face Verification V4

## 1:1 Face Verification V4

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v4/verify`

#### Request Body

| Name         | Type   | Description                                             |
| ------------ | ------ | ------------------------------------------------------- |
| apiKey       | string | To be assigned by Innov8tif                             |
| imageIdCard  | string | Front id card image in base64                           |
| imageBest    | string | Image in base64 that's used to compare with imageIdCard |

{% tabs %}
{% tab title="200 " %}

```
{"request_id":"8fa0cdcf-5f50-4671-8db1-47145232d200","result_idcard":{"confidence":0.51890767}}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
	"apiKey": "apiKey",
	"imageIdCard": "",
	"imageBest": ""
}
```

{% endcode %}

{% file src="/files/-Lvj8QgW-0daPeK0kVtC" %}
OkayFace v4
{% endfile %}

### Recommended Threshold: 1.0

| Face Verification Status | Description                         |
| ------------------------ | ----------------------------------- |
| Pass                     | Confidence >= Recommended Threshold |
| Fail                     | Confidence < Recommended Threshold  |

###


# Change Log

## Endpoint Version 4

### Core Version 4.0.0.0

* Created base model


# 1:1 Face Verification V2-1

## 1:1 Face Verification With Liveness Detection (Encrypted string is not required)

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v2-1/verify`

#### Request Body

| Name         | Type   | Description                 |
| ------------ | ------ | --------------------------- |
| apiKey       | string | To be assigned by Innov8tif |
| imageIdCard  | object | Front id card image         |
| imageBest    | object | Selfie photo                |

{% tabs %}
{% tab title="200 " %}

```
{
"imageBestLiveness":
    {
        "probability":2.492201929271687E-7,
        "score":-5.0898823738098145,
        "quality":1.0
    },
"request_id":"TASKAI208003201910300952440191412201",
"result_idcard":
    {
        "confidence":57.86325
    }
}
```

{% endtab %}
{% endtabs %}

### Input Example in Postman

![](/files/-M0LHVNRJN9g-RNoLT9p)

{% file src="/files/-Lx4UwZAyYKX2wvJhWe6" %}
OkayDoc v2-1
{% endfile %}

### Interpretation of Result

| Key         | Value                                                |
| ----------- | ---------------------------------------------------- |
| confidence  | Test passes if more than 75 (recommended threshold)  |
| probability | Probability of liveness                              |
| score       | Linear liveness score: bigger value means more alive |
| quality     | Quality value                                        |
| error       | Error message from the server                        |

* Probability of liveness is a main response of the system.
* The image is accepted as "**live**" when a ***probability*** is **bigger** than **0.5**.
* Linear liveness score can be used for BPCER / APCER tuning.&#x20;
* The range of score is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Probability can be **lower** than **0.5** by the reasons below.

  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.

> We highly advise to analyze quality value and reject inappropriate images.


# Change Log

## Endpoint Version 2-1

### Core Version 2.0.1.1 - 30/9/2021

**-New Features:**

NA

**-Bug Fixes:**

NA

-**Enhancements:**

* Improved liveness accuracy

### Core Version 2.0.1.0

* Created base model


# 1:1 Face Verification V2-2

## 1:1 Face Verification With Liveness Detection

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v2-2/verify`

#### Request Body

| Name         | Type   | Description                   |
| ------------ | ------ | ----------------------------- |
| apiKey       | string | To be assigned by Innov8tif   |
| imageIdCard  | string | Front id card image in base64 |
| imageBest    | string | Selfie photo in base64        |

{% tabs %}
{% tab title="200 " %}

```
{"imageBestLiveness":{"probability":1.8339830987201822E-8,"score":-6.1092305183410645,"quality":1.0},"request_id":"53b7443b-2cf9-407e-a710-b304a6a569a5","result_idcard":{"confidence":{"imageBestLiveness":{"probability":0.03970755,"score":-3.1856966,"quality":0.7613958},"request_id":"1588554351758433I8E5268147307508","result_idcard":{"confidence":59.11985}}}}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
	"apiKey": "apiKey",
	"imageIdCard": "",
	"imageBest": ""
}
```

{% endcode %}

{% file src="/files/-M-TC6gtO9y8l925TiLo" %}

### Interpretation of Result

| Key         | Value                                                |
| ----------- | ---------------------------------------------------- |
| confidence  | Test passes if more than 75(recommended threshold)   |
| probability | Probability of liveness                              |
| score       | Linear liveness score: bigger value means more alive |
| quality     | Quality value                                        |
| error       | Error message from the server                        |

* Probability of liveness is a main response of the system.
* The image is accepted as "**live**" when a ***probability*** is **bigger** than **0.5**.
* Linear liveness score can be used for BPCER / APCER tuning.&#x20;
* The range of score is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Probability can be **lower** than **0.5** by the reasons below.
  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.


# Change Log

## Endpoint Version 2-2

### Core Version 2.0.2.1 - 30/9/2021

**-New Features:**

NA

**-Bug Fixes:**

NA

-**Enhancements:**

* Improved liveness accuracy

### Core Version 2.0.2.0

* Created base model


# 1:1 Face Verification V3-1

## 1:1 Face Verification With Liveness Detection (Encrypted string is required)

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v3-1/verify`

#### Request Body

| Name         | Type   | Description                                                   |
| ------------ | ------ | ------------------------------------------------------------- |
| apiKey       | string | To be assigned by Innov8tif                                   |
| imageIdCard  | object | Front id card image                                           |
| imageBest    | string | Encrypted string for liveness face retrieved via liveness SDK |

{% tabs %}
{% tab title="200 Response without liveness checking" %}

```
{"imageBestLiveness":
    {
        "probability":2.492201929271687E-7,
        "score":-5.0898823738098145,
        "quality":1.0
    },
"request_id":"TASKAI208003201910300952440191412201",
"result_idcard":
    {
        "confidence":57.86325
    }
}
```

{% endtab %}
{% endtabs %}

### Interpretation of Result

| Key         | Value                                                |
| ----------- | ---------------------------------------------------- |
| confidence  | Test passes if more than 75 (recommended threshold)  |
| probability | Probability of liveness                              |
| score       | Linear liveness score: bigger value means more alive |
| quality     | Quality value                                        |
| error       | Error message from the server                        |

* Probability of liveness is a main response of the system.
* The image is accepted as "**live**" when a ***probability*** is **bigger** than **0.5**.
* Linear liveness score can be used for BPCER / APCER tuning.&#x20;
* The range of score is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Probability can be **lower** than **0.5** by the reasons below.

  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.

> We highly advise to analyze quality value and reject inappropriate images.


# Change Log

## Endpoint Version 3-1

### Core Version 3.0.1.0

* Created base model


# 1:1 Face Verification V4-1

## 1:1 Face Verification With Liveness Detection

<mark style="color:green;">`POST`</mark> `http://demo.faceid.asia/api/faceid/v4-1/verify`

#### Request Body

| Name         | Type   | Description                   |
| ------------ | ------ | ----------------------------- |
| apiKey       | string | To be assigned by Innov8tif   |
| imageIdCard  | string | Front id card image in base64 |
| imageBest    | string | Selfie photo in base64        |

{% tabs %}
{% tab title="200 " %}

```
{"imageBestLiveness":{"probability":1.8339830987201822E-8,"score":-6.1092305183410645,"quality":1.0},"request_id":"53b7443b-2cf9-407e-a710-b304a6a569a5","result_idcard":{"confidence":0.51890767}}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
	"apiKey": "apiKey",
	"imageIdCard": "",
	"imageBest": ""
}
```

{% endcode %}

{% file src="/files/-LvjA0OBxo6-wU4SchY1" %}
OkayFace v4-1
{% endfile %}

### Interpretation of Result

| Key         | Value                                                |
| ----------- | ---------------------------------------------------- |
| confidence  | Test passes if more than 1.0(recommended threshold)  |
| probability | Probability of liveness                              |
| score       | Linear liveness score: bigger value means more alive |
| quality     | Quality value                                        |
| error       | Error message from the server                        |

* Probability of liveness is a main response of the system.
* The image is accepted as "**live**" when a ***probability*** is **bigger** than **0.5**.
* Linear liveness score can be used for BPCER / APCER tuning.&#x20;
* The range of score is (ln 1e-7, -ln 1e-7).
* Quality value is a probability of "appropriate image".
* Value can be **lower** than **0.5** by the reasons below.
  * Face minimal side is less than 180 pix or distance between eyes is less than 90 pix.
  * Face out-of-plane rotation is bigger than 20 degrees.
  * The distance between face and camera is very small, so the face can be significantly distorted.
  * The luminous power is insufficient.
  * High motion or gaussian blur rate or light shot.


# Change Log

## Endpoint Version 4-1

### Core Version 4.0.1.0

* Created base model


# Image Requirements

### General Image Requirements&#x20;

Below are the requirements for size and quality of document images captured by any device, which are necessary for successful image processing by OkayFace:

**Maximum File Size:**

* imageIdCard (ID Card Image) = 3MB
* imageBest (selfie) = 3MB

**Minimum Resolution:**

* 450px x 450px

{% hint style="info" %}
It is recommended to use uncompressed formats. If it’s not possible, then use compress image with the highest quality to make sure that the API detection is accurate.
{% endhint %}

### Capture Requirements

**To Avoid:**

1. Blurry or motion blur selfie image that will decrease the accuracy of the API.
2. Overly compressed image that will decrease the accuracy of the API.
3. Selfie that is taken in landscape mode that will cause detection error.
4. Environment that is too bright or too dark that cause API fail to pick up the selfie's facial features.
5. Multiple faces in the background of the selfie.
6. Facial position that is too near or too far from the selfie image.

**To Do:**

1. Facing straight to the camera to ensure the API detection is able to detect the facial features accurately.
2. Retain a portion of margin surrounding the selfie image to prevent API fail to detect face.
3. Make sure the selfie's head is within the picture frame.

{% hint style="warning" %}
All of the following mentioned above will positively/negatively affect the accuracy of the API.
{% endhint %}

### Examples of Correct Selfie Image:

![](/files/-MdGyq68s6Uz6K5yqWZH)

![](/files/-MdH0ToH0Cm-YPjOMxr1)

![](/files/-MdH0XKpbS0HcjxUC8v2)

**Examples of Incorrect Selfie Image:**

![BLUR IMAGE](/files/-MdHAeC-XZc_CEGGAKZZ)

![FACE TOO CLOSE TO BORDER](/files/-MdHAjsEtQNaL_vNhOpU)

![INTERPUPILLARY DISTANCE IS TOO SMALL](/files/-MdHApbRs6vp4WeZURXt)

![MULTIPLE FACES](/files/-MdHB-TRPkgg0rwWxh_Y)

{% hint style="info" %}
Examples of the correct samples are references to guide the user to take a good selfie without facing errors or getting low accuracy for the API detection.&#x20;
{% endhint %}


# Error List

{% code title="Missing apiKey" %}

```
{"error":"MISSING_ARGUMENT: apiKey","request_id":null}
```

{% endcode %}

{% code title="Wrong apiKey" %}

```
{"error":"INVALID_API_KEY","request_id":null}
```

{% endcode %}

{% code title="API key expired" %}

```
{
    "status": "error",
    "message": "API_KEY_EXPIRED",
    "result": null
}
```

{% endcode %}

{% code title="Maximum API call hit" %}

```
{
    "status": "error",
    "message": "MAX_API_CALL_EXCEEDED",
    "result": null
}
```

{% endcode %}

{% code title="Missing imageIdCard/imageBest" %}

```
{"error":"MISSING_ARGUMENTS: imageIdCard or imageBest","request_id":null}
```

{% endcode %}

{% code title="imageIdCard/imageBest's file size more than 3MB " %}

```
{"error":"PAYLOAD_TOO_LARGE"}
```

{% endcode %}

{% code title="Invalid imageIdCard/imageBest Format(Support：jpg、jpeg、png)" %}

```
{"error":"Photo format error","request_id":null}
```

{% endcode %}

{% code title="Invalid imageIdCard/imageBest has no face detected" %}

```
{"error":"FACE_NOT_FOUND","request_id":"xxxxxxxxxx"}
```

{% endcode %}

#### Error messages

| Error                          | Description                                                                                                                          |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| FACE\_TOO\_CLOSE               | A distance between face and camera is too small for preprocessing issues                                                             |
| FACE\_CLOSE\_TO\_BORDER        | Face is too close to one or more borders. May reduce the accuracy of spoofing detection because edges of face may not be seen        |
| FACE\_CROPPED                  | Face is cropped. May reduce the accuracy of spoofing detection because edges of face may not be seen                                 |
| FACE\_IS\_OCCLUDED             | There is occlusion on the face or it is difficult to see face, which degrades the quality of liveness                                |
| FACE\_NOT\_FOUND               | Face detector can't find face on image                                                                                               |
| TOO\_MANY\_FACES               | Face detector found more than one face on image                                                                                      |
| FACE\_TOO\_SMALL               | Facial area is not big enough for analysis. Either interpupillary distance(80px) or face size(224 px) is below the configured value. |
| FACE\_ANGLE\_TOO\_LARGE        | Facial out-of-plane rotation angle is extremely large                                                                                |
| FAILED\_TO\_PREDICT\_LANDMARKS | Landmarks prediction error                                                                                                           |
| UNKNOWN                        | Unhandled exception in the code                                                                                                      |


# Face Search \[BETA TESTING]

This API allows the user to Query or Insert Faces

This API allows the user to Query or Insert faces by submitting image that contains facial features

{% content-ref url="/pages/-MjTbZaFQ5lXQ4OFR1sw" %}
[Face Insert](/okayface/face-search/face-insert)
{% endcontent-ref %}

{% content-ref url="/pages/-MjTbTz-99XVqUkc-M4P" %}
[Face Query](/okayface/face-search/face-query)
{% endcontent-ref %}

### Postman Collection for Face Search

{% file src="/files/-MjTQxQOo0YSJzDstd6C" %}
Innov-Face Query/Insert.collection
{% endfile %}


# Face Insert

## Insert

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/innov-face/facequery/insert`

This API enables insertion of the facial image to database for query

#### Request Body

| Name        | Type   | Description                              |
| ----------- | ------ | ---------------------------------------- |
| apiKey      | string | To be assigned by Innov8tif              |
| imageBase64 | string | Selfie Image or Portrait Image in base64 |
| imageFile   | string | Selfie Image or Portrait Image           |
| groupName   | string | Group that exists in the database        |
| userName    | string | The person's name of the facial image    |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "groupName": "innov8tiftestnew",
    "groupStatus": "EXISTING",
    "name": "Jin-Xuan"
}
```

{% endtab %}
{% endtabs %}

### Input Example in Postman

![](/files/-MjTjGbcjUn-SN2ygt6S)

{% hint style="warning" %}
Insert facial image need to fulfill the [image requirement](https://api.innov8tif.com/okayface/image-requirements) for better accuracy
{% endhint %}

### Possible Responses

{% code title="When face is detected in the image and successful detected" %}

```
{
    "status": "success",
    "groupName": "Innov8tif_test_new",
    "groupStatus": "EXISTING",
    "name": "Jin-Xuan" 
}
```

{% endcode %}

{% code title="When no face is detected in image:" %}

```
{
    "status": "error",
    "message": "There is No Face Detected in Image" 
}
```

{% endcode %}


# Face Query

## Query

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/innov-face/facequery/query`

This API enables the querying and match the facial image in database to check for existence

#### Request Body

| Name        | Type   | Description                                                       |
| ----------- | ------ | ----------------------------------------------------------------- |
| apiKey      | string | To be assigned by Innov8tif                                       |
| imageBase64 | string | Selfie image or portrait image in base64                          |
| imageFile   | string | Selfie image or portrait image                                    |
| groupName   | string | Group name that existed in database that matches the facial image |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "zhiyan",
    "score": 0.0
}
```

{% endtab %}
{% endtabs %}

### Input Example in Postman

![](/files/-MjTistx9xCGGTsxyQqo)

{% hint style="warning" %}
Query facial image need to fulfill the [image requirement](https://api.innov8tif.com/okayface/image-requirements) for better accuracy
{% endhint %}

### Possible Responses

{% code title="When image is found in the group (database table)" %}

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "zhiyan",
    "score": 0.0
}
```

{% endcode %}

{% code title="When group does exists but cannot find similar face" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": true
}
```

{% endcode %}

{% code title="When group does not exist" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}

{% code title="When no face detected in image" %}

```
{
    "status": "error",
    "message": "There is No Face Detected in Image",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}

### Threshold

The score of the successful image found are listed below:

| Threshold Value   | Description Status |
| ----------------- | ------------------ |
| **Score** > 0.53  | Query Pass         |
| **Score** <= 0.53 | Query Fail         |

{% hint style="info" %}
The lower the score, the higher the confidence of the Face Search API comparing the face with the database.
{% endhint %}


# Change Log

## Endpoint Version 1

### Core Version 1.0 (2021-09-15)

* Created base model.


# Getting Started with Face Detector

### Face Detector Mobile SDK

Face Detector mobile SDK that contains custom camera UI that design suitably to perform the detection on the face region which specifically focuses on the eyes of the user.&#x20;

## Requirements

#### Android

* minSdkVersion 21

#### iOS

* Swift 5+&#x20;
* iOS 11.0+ (arm64)


# Installation Guide

This page contains the installation guide needed for Face Detector in Android and iOS

{% tabs %}
{% tab title="Android" %}

### Android Installation Guide

In Android, the first step of the installation for Face Detector (Android) is to include the following dependencies in the **project-level build.gradle** file. The **build.gradle** file will need to make some changes as follow below:

```
allprojects {  
  repositories {  
        mavenCentral()
   }
 }
```

Include the following dependencies in **app-level build.gradle** file:

```
android {
    ...
    aaptOptions {
        noCompress "tflite"
    }
}

dependencies{
	 implementation 'com.innov8tif.facedetector:FaceDetector:0.0.3'
}
```

After adding the code, sync the project with gradle files to make sure all of the dependencies are successfully installed.

{% hint style="info" %}
Please make sure that the gradle files are synced
{% endhint %}
{% endtab %}

{% tab title="iOS" %}

### iOS Installation Guide

In iOS, the first step of the installation for Face Detector is to simply add the following line of code to your **Podfiles** as shown below:

```
use_frameworks!
pod 'FaceDetector', '0.0.3'

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "CryptoSwift"
            puts "Enable module stability for CryptoSwift"
            target.build_configurations.each do |config|
                config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
            end
        end
    end
end
```

After adding the code above to the **Podfiles**:&#x20;

* Run the command "pod install" to install the dependency
  {% endtab %}

{% tab title="React-Native" %}

### React-Native Installation Guide

In React-native, the first step of the installation is to install the react-native-innov8tif-face-detector into the environment using the command below:

```
react-native install react-native-innov8tif-face-detector@0.0.1
```

#### Android

Add the code below in app build.gradle file

````
android {
    ```
    aaptOptions {
        noCompress "tflite"
    }
}
````

####

#### iOS

1. Navigate to ios folder
2. Add the following code to Podfile

````
platform :ios, '11.0'
use_frameworks!

    ```

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "CryptoSwift"
			puts "Enable module stability for CryptoSwift"
			target.build_configurations.each do |config|
				config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
			end
        end
    end
end

````

3\.  Run command `Pod install`

####

### License

Apply licenses for Android and iOS SDKs

```
const license = Platform.select({
    android: "",
    ios: ""
})
```

{% endtab %}
{% endtabs %}


# Development

This page contains the information of Usage, Configuration, Result of OkayDoc for Android and iOS

{% tabs %}
{% tab title="Android" %}

### Usage

For Android, **a valid license key is required** to start the process.

###

### Configuration

Build the configuration object with the following **`Config` properties** listed below:

| Config        | Possible Input Range | Default |
| ------------- | -------------------- | ------- |
| path          | String               | null    |
| faceThreshold | between 0.0 and 1.0  | 0.9     |
| eyeThreshold  | between 0.0 and 1.0  | 0.5     |

```
Config config = new Config.Builder()
                .setImagePath(imagePath)
                .setFaceThreshold(0.9f)
                .setEyeThreshold(0.5f)
                .build();
```

###

### SDK Initialization

&#x20;Start the process by calling `startDetection` on `FaceDetectorSDK` as shown below. You must also pass a valid license string and a config into it.

```
FaceDetectorSDK.startDetection(this, licenseKey, config, new FaceDetectorResultListener() {
    @Override
    public void onResultReceived(boolean successful, int errorCode, FaceAttr result) {

        if (successful) {
            // handle result
        }
        else {
            // handle error
        }
    }
});
```

###

### Result

| Name           | Description                           |
| -------------- | ------------------------------------- |
| getFaceImage   | face image                            |
| isFaceDetected | returns true if face detected         |
| isEye1Detected | returns true if first eye is detected |
| isEye2Detected | return true if second eye is detected |

###

### Error Code

&#x20;`errorCode` is an `int` which can have the following values:

| Error Code   | Constant Name                          | Description                                            |
| ------------ | -------------------------------------- | ------------------------------------------------------ |
| -1           | FaceError.NO\_ERROR                    | Face is successfully detected                          |
| 1            | FaceError.ERROR\_INVALID\_LICENSE\_KEY | The license is invalid                                 |
| 2            | FaceError.ERROR\_PERMISSION\_DENIED    | The user did not grant the permission to access camera |
| 3            | FaceError.ERROR\_USER\_CANCEL\_ACTION  | The user canceled during the scanning process          |
| 4            | FaceError.ERROR\_TIME\_OUT             | 10 seconds timer is triggered when face is detected    |
| {% endtab %} |                                        |                                                        |

{% tab title="iOS" %}

### Usage

Start by adding the `NSCameraUsageDescription` to your `info.plist`.

import `FaceDetector` module into your swift file.

```
import FaceDetector
```

###

### Configuration

Build the configuration object with the following **`Config` properties** listed below:

| Config        | Possible Input Range | Default |
| ------------- | -------------------- | ------- |
| path          | String               | nil     |
| faceThreshold | between 0.0 and 1.0  | 0.9     |
| eyeThreshold  | between 0.0 and 1.0  | 0.5     |

```
let config = Config.Builder()
        .setPath(imagePath)
        .setFaceThreshold(0.9)
        .setEyeThreshold(0.5)
        .build()
```

###

### SDK Initialization

Start the process by calling `startDetection` on `FaceDetectorSDK` as shown below. You must also pass a valid license string and a reference to your view controller. `self` refers to the current view controller in this example below:

```
FaceDetectorSDK.startDetection(
    viewController: self,
    license: license,
    config: config
)
{ success, errorCode, result in
    if(success) {
        // handle success
    } else {
        // handle error
    }
}
```

###

### Result

| Name         | Description                           |
| ------------ | ------------------------------------- |
| faceImage    | face image                            |
| faceDetected | returns true if face detected         |
| eye1Detected | returns true if first eye is detected |
| eye2Detected | return true if second eye is detected |

###

### Error Handling

The error received in the completion handler is of the type `FaceError`:

```
public enum FaceError: Error {
    // Error due to invalid parameter value in config object.
    case invalidConfig(_ msg: String)
    
    // Any other errors.
    case miscellaneous(_ msg: String)
    
    // Error due to user clicking cancel and going back.
    case userCancelled
    
    // Error due to invalid license usage.
    case invalidLicense
    
    // No error at all.
    case noError
    
    // Error due to camera permission denied by user.
    case cameraPermission
    
    // image file not found
    case invalidImage
    
    // Timeout error
    case timeout
}
```

{% endtab %}

{% tab title="React-Native" %}

### Usage

Import plugin by using the code below

```
import { detectFaceWithImage, detectFaceWithVideo } from 'react-native-innov8tif-face-detector';
```

###

### Configurations

| Property name | Description                         | Default value |
| ------------- | ----------------------------------- | ------------- |
| license       | license key                         | empty         |
| base64        | return base64 string as image ouput | false         |
| path          | image file path                     | nil           |
| faceThreshold | face threshold                      | 0.9           |
| eyeThreshold  | eye threshold                       | 0.5           |

###

### Code Implementation

Detect face with video processing

```
detectFaceWithVideo({
    license: licenseKey,
    base64: true,
    faceThreshold: 0.5,
    eyeThreshold: 0.5
})
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.log(error)
    })
```

Detect face with image processing

```
detectFaceWithImage({
    license: licenseKey,
    base64: true,
    path: <imagePath>
    faceThreshold: 0.5,
    eyeThreshold: 0.5
})
    .then(result => {
        console.log(result)
    })
    .catch(error => {
        console.log(error)
    })
```

###

### Result

| Result         | Description                      |
| -------------- | -------------------------------- |
| faceImage      | face image output                |
| isFaceDetected | return true if face is detected  |
| isEye1Detected | return true if eye 1 is detected |
| isEye2Detected | return true if eye 2 is detected |

###

### Error Codes

| Error                    | Description                                            |
| ------------------------ | ------------------------------------------------------ |
| invalid license          | The license is invalid                                 |
| camera permission denied | The user did not grant the permission to access camera |
| cancel                   | The user canceled during the scanning process          |
| timeout                  | Timeout due to face not detected within preset timer   |
| {% endtab %}             |                                                        |
| {% endtabs %}            |                                                        |


# Changelog


# Android

This page shows the changes being made in the Face Detector - Mobile SDK

## Version 0.0.3

Face Detector - Mobile SDK is released


# iOS

This page shows the changes being made in the FaceDetector - Mobile SDK

## Version 0.0.3

Face Detector - Mobile SDK is released


# React-Native

## Version 0.0.1

Face Detector - Mobile SDK is released


# OkayDoc - Overall

### Page Link

{% content-ref url="/pages/-LtwbJ4X94zFtKhlv06C" %}
[Brunei](/okaydoc/brunei)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFlEgRk-RIePwkPslT" %}
[Cambodia](/okaydoc/cambodia)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPixabE3m1UijXCWRT" %}
[Indonesia](/okaydoc/indonesia)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPd6eQTsuvwx3psj8S" %}
[Malaysia](/okaydoc/malaysia)
{% endcontent-ref %}

{% content-ref url="/pages/-Ltw\_Lkb42Efdy5tuza4" %}
[Myanmar](/okaydoc/myanmar)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPoEGyMKizIB2uU1XO" %}
[Philippines](/okaydoc/philippines)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPjiATAFcuofu0VhAp" %}
[Singapore](/okaydoc/singapore)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwNa9f6N1vaubJ85Pt" %}
[Thailand](/okaydoc/thailand)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwUq0Q535fhTCHlBAo" %}
[United Arab Emirates](/okaydoc/united-arab-emirates)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwXlj12yBvU4i8gcVF" %}
[Vietnam](/okaydoc/vietnam)
{% endcontent-ref %}

{% content-ref url="/pages/-M0Ft8LhtHecqBVwacv\_" %}
[Non Passport](/okaydoc/non-passport)
{% endcontent-ref %}

{% content-ref url="/pages/-LpSKMyvR4dpBjQTAtJV" %}
[Passport](/okaydoc/passport)
{% endcontent-ref %}

{% content-ref url="/pages/-LsPb4PgbGQIBXaKJerj" %}
[Error List](/okaydoc/error-list)
{% endcontent-ref %}

{% content-ref url="/pages/-M1OjpidB1Tc7r9C9O4o" %}
[Supported Documents and Check Type](/okaydoc/supported-documents-and-check-type)
{% endcontent-ref %}

{% content-ref url="/pages/-M-hwUGwk5BpWAz3IEKe" %}
[Image Requirements](/okaydoc/image-quality-requirements)
{% endcontent-ref %}


# Brunei

{% content-ref url="/pages/-LtwbOKMvOLDLjrXl5z4" %}
[BN - Domestic ID Card](/okaydoc/brunei/bn-domestic-id-card)
{% endcontent-ref %}

{% content-ref url="/pages/-Ltwbe8UfGFr\_c\_7jEMY" %}
[BN - Permanent ID Card](/okaydoc/brunei/bn-permanent-id-card)
{% endcontent-ref %}


# BN - Domestic ID Card

{% content-ref url="/pages/-MbiPqtJdtWu8H3BmFu2" %}
[Change Log](/okaydoc/brunei/bn-domestic-id-card/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwbcdNEnKKDC7zun12" %}
[Version 1](/okaydoc/brunei/bn-domestic-id-card/version-1)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwcYx7FWM\_r\_2sZMHK" %}
[Recommended Threshold And Sample for Landmarks](/okaydoc/brunei/bn-domestic-id-card/recommended-threshold-for-landmarks)
{% endcontent-ref %}


# Change Log

### Endpoint Version 1

#### Core Version 1.0.1.2

* Created base model


# Version 1

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/ekyc/v1/doc-verify/bn-did`

#### Request Body

| Name               | Type   | Description                   |
| ------------------ | ------ | ----------------------------- |
| caseNo             | string | Reference code given by user  |
| apiKey             | string | To be assigned by Innov8tif   |
| idImageBase64Image | string | Front id card image in base64 |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "messageCode": "api.success",
    "message": "",
    "id": "1be598ac-2cfd-4e01-a4f5-e3a3c518a965",
    "methodList": [
        {
            "method": "landmark",
            "label": "Landmark Analysis Result",
            "componentList": [
                {
                    "code": "l-bn-did-header",
                    "label": "Kad Pengenalan Header",
                    "value": "99.62129592895508",
                    "imageUrl": "/public/image/v2/xxxxxxx?type=l-bn-did-header",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-country",
                    "label": "Negara Brunei Darussalam",
                    "value": "99.73549246788025",
                    "imageUrl": "/public/image/v2/xxxxxxx?type=l-bn-did-country",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-logo",
                    "label": "Logo",
                    "value": "99.85308051109314",
                    "imageUrl": "/public/image/v2/xxxxxxxxxx?type=l-bn-did-logo",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-name",
                    "label": "Nama",
                    "value": "99.43906664848328",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-bn-did-name",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-dob",
                    "label": "Tarikh Lahir",
                    "value": "99.0774154663086",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-bn-did-dob",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-gender",
                    "label": "Jantina",
                    "value": "99.18878078460693",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-bn-did-gender",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-birth-place",
                    "label": "Negeri Tempat Lahir",
                    "value": "99.20533299446106",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxxx?type=l-bn-did-birth-place",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-did-resident",
                    "label": "Warganegara",
                    "value": "99.31186437606812",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxxxx?type=l-bn-did-resident",
                    "refImageUrl": null
                }
            ]
        }
    ],
    "outputImageList": [
        {
            "tag": "cropId",
            "imageUrl": "/public/image/v2/1be598ac-2cfd-4e01-a4f5-e3a3c518a965?type=cropId"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
    "apiKey": "apiKey",
    "caseNo": "CASE 123",
    "idImageBase64Image": "/9j/4AAQSkZJ...fYs1wRtQHt//Z\r\n" 
}
```

{% endcode %}

{% file src="/files/-LtxKZaknY9WORzYUCNT" %}
OkayDoc Domestic ID Front
{% endfile %}


# Recommended Threshold And Sample for Landmarks

### Recommended Threshold

| Item                     | Threshold |
| ------------------------ | --------- |
| Kad Pengenalan Header    | 30        |
| Negara Brunei Darussalam | 30        |
| Logo                     | 30        |
| Nama                     | 30        |
| Tarikh Lahir             | 30        |
| Jantina                  | 30        |
| Negeri Tempat Lahir      | 30        |
| Warganegara              | 30        |

### Sample&#x20;

![Kad Pengenalan Header](/files/-M62ZdqVhZ7LaOw8TpqT)

![Negara Brunei Darussalam](/files/-M62ZifOdKb_Tmng0EPx)

![Logo](/files/-M62ZmaEzIYIROzpOT02)

![Nama](/files/-M62ZqKZ_uEifhy3aaBk)

![Tarikh Lahir](/files/-M62Zx6xT9RQ1gkaVikL)

![Jantina](/files/-M62_0UF6Iw39a-KJB0b)

![Negeri Tempat Lahir](/files/-M62_3evgLV0aHvcLDhn)

![Warganegara](/files/-M62_6N8uU4IH8UkUWmK)


# BN - Permanent ID Card

{% content-ref url="/pages/-MbiQZaZB4gJS3ZOiM9X" %}
[Change Log](/okaydoc/brunei/bn-permanent-id-card/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-Ltwd75zp7hOYijBQOPz" %}
[Version 1](/okaydoc/brunei/bn-permanent-id-card/version-1)
{% endcontent-ref %}

{% content-ref url="/pages/-LtwdMcrrWnjpejGjfqp" %}
[Recommended Threshold And Sample for Landmarks](/okaydoc/brunei/bn-permanent-id-card/recommended-threshold-for-landmarks)
{% endcontent-ref %}


# Change Log

### Endpoint Version 1

#### Core Version 1.0.1.2

* Created base model


# Version 1

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/ekyc/v1/doc-verify/bn-pid`

#### Request Body

| Name               | Type   | Description                   |
| ------------------ | ------ | ----------------------------- |
| caseNo             | string | Reference code given by user  |
| apiKey             | string | To be assigned by Innov8tif   |
| idImageBase64Image | string | Front id card image in base64 |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "messageCode": "api.success",
    "message": "",
    "id": "8d5301d1-d5f6-440a-ba43-3e620bf15b1f",
    "methodList": [
        {
            "method": "landmark",
            "label": "Landmark Analysis Result",
            "componentList": [
                {
                    "code": "l-bn-pic-id-card",
                    "label": "Kad Pengenalan Header",
                    "value": "99.59200024604797",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxx?type=l-bn-pic-id-card",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-country",
                    "label": "Negara Brunei Darussalam",
                    "value": "99.5351254940033",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-bn-pic-country",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-logo",
                    "label": "Logo",
                    "value": "99.79479908943176",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-bn-pic-logo",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-name",
                    "label": "Nama",
                    "value": "99.34593439102173",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-bn-pic-name",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-dob",
                    "label": "Tarikh Lahir",
                    "value": "99.16449189186096",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-bn-pic-dob",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-gender",
                    "label": "Jantina",
                    "value": "99.05832409858704",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxxx?type=l-bn-pic-gender",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-birth-place",
                    "label": "Negeri Tempat Lahir",
                    "value": "99.07551407814026",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-bn-pic-birth-place",
                    "refImageUrl": null
                },
                {
                    "code": "l-bn-pic-permanent-r",
                    "label": "Penduduk Tetap",
                    "value": "99.08776879310608",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxx?type=l-bn-pic-permanent-r",
                    "refImageUrl": null
                }
            ]
        }
    ],
    "outputImageList": [
        {
            "tag": "cropId",
            "imageUrl": "/public/image/v2/8d5301d1-d5f6-440a-ba43-3e620bf15b1f?type=cropId"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

{% code title="JSON" %}

```
{
    "apiKey": "apiKey",
    "caseNo": "CASE 123",
    "idImageBase64Image": "/9j/4AAQSkZJ...fYs1wRtQHt//Z\r\n" 
}
```

{% endcode %}

{% file src="/files/-LtxKhRL3BAJ-E-BAJq3" %}
OkayDoc Permanent ID Front
{% endfile %}


# Recommended Threshold And Sample for Landmarks

### Recommended Threshold

| Item                     | Threshold |
| ------------------------ | --------- |
| Kad Pengenalan Header    | 30        |
| Negara Brunei Darussalam | 30        |
| Logo                     | 30        |
| Nama                     | 30        |
| Tarikh Lahir             | 30        |
| Jantina                  | 30        |
| Negeri Tempat Lahir      | 30        |
| Penduduk Tetap           | 30        |

### Sample

![Kad Pengenalan Header](/files/-M62avGtDqjRXEffAmKc)

![Negara Brunei Darussalam](/files/-M62b2YDDO_eRqYCvqu8)

![Logo](/files/-M62b5Xzr6fmqTiGBVVr)

![Nama](/files/-M62b9Jg8w13wiynLReY)

![Tarikh Lahir](/files/-M62bC_F0Ls1775bTLvH)

![Jantina](/files/-M62bFSrTPNJ2Jz78CLr)

![Negeri Tempat Lahir](/files/-M62bIHXSUD2tJSrwLmx)

![Penduduk Tetap](/files/-M62bLSJrww48Fdtc0Xh)


# Cambodia

{% content-ref url="/pages/-LuFrNQGqYEp3Tp2ONhY" %}
[KH - ID Card Front](/okaydoc/cambodia/kh-id-card-front)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFm6BkjkBoNUR0YyTb" %}
[KH - ID Card Back](/okaydoc/cambodia/kh-id-card-back)
{% endcontent-ref %}


# KH - ID Card Front

{% content-ref url="/pages/-MbiTIdDhBeHN-3RGSWC" %}
[Change Log](/okaydoc/cambodia/kh-id-card-front/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-M5tXVeZw\_OKiWUHuvxb" %}
[Version 2](/okaydoc/cambodia/kh-id-card-front/version-2)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFrXrk8F48icO3BKuY" %}
[Version 1](/okaydoc/cambodia/kh-id-card-front/version-1)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFt\_HV5hyOLWOSCRqj" %}
[Recommended Threshold And Sample for Landmarks](/okaydoc/cambodia/kh-id-card-front/recommended-threshold-for-landmarks)
{% endcontent-ref %}


# Change Log

## Endpoint Version 2

### Core Version 2.0.1.3 - 2/6/2021

**-New Features:**

* All detections/checks are now checkable through parameters

**-Bug Fixes:**

* Images below the size of the minimum image requirement will now fail all results

-**Enhancements:**

* Improved Accuracy for Color Detection&#x20;
* Improved Accuracy and Processing Time for Photo Substitution

### Core Version 2.0.1.2

**-New Features:**

* Added blurriness detection
* Added brightness detection
* Added color detection
* Added hologram detection
* Added screen detection
* Added substitution check
* Added ID tamper detection

\
-**Bug Fixes:**

NA

**-Enhancements**

NA

## Endpoint Version 1

### Core Version 1.0.1.2

* Created base model


# Version 2

Added blurriness detection, brightness detection, color detection, hologram detection, screen detection, substitution checking, ID tamper detection

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/ekyc/v2/doc-verify/kh-id-front`

#### Request Body

| Name                   | Type   | Description                                                           |
| ---------------------- | ------ | --------------------------------------------------------------------- |
| fontCheck              | string | <p>Default is True.<br>To enable /disable ID Tamper Detection</p>     |
| photoSubstitutionCheck | string | <p>Default is True.<br>To enable/disable photo substitution check</p> |
| hologram               | string | <p>Default is True.<br>To enable/disable hologram detection</p>       |
| screenDetection        | string | <p>Default is True.<br>To enable/disable screen detection</p>         |
| colorMode              | string | <p>Default is True.<br>To enable/disable color detection.</p>         |
| idBrightnessDetection  | string | <p>Default is True.<br>To enable/disable id brightness detection</p>  |
| idBlurDetection        | string | <p>Default is True.<br>To enable/disable id blurriness detection</p>  |
| landmarkCheck          | string | <p>Default is True.<br>To enable/disable landmark check</p>           |
| caseNo                 | string | Reference code given by user                                          |
| apiKey                 | string | To be assigned by Innov8tif                                           |
| idImageBase64Image     | string | Front id card image in base64                                         |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "messageCode": "api.success",
    "message": "",
    "id": "c03e4ecb-81aa-4416-83b2-e7a225e7b101",
    "methodList": [
        {
            "method": "landmark",
            "label": "Landmark Analysis Result",
            "componentList": [
                {
                    "code": "l-kh-id-front-landmark1",
                    "label": "Landmark 1",
                    "value": "97.12206721305847",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark1",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark2",
                    "label": "Landmark 2",
                    "value": "94.71385478973389",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark2",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark3",
                    "label": "Landmark 3",
                    "value": "97.7009654045105",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark3",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark4",
                    "label": "Landmark 4",
                    "value": "97.96249270439148",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark4",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark5",
                    "label": "Landmark 5",
                    "value": "93.39374303817749",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark5",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark6",
                    "label": "Landmark 6",
                    "value": "98.3284592628479",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark6",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark7",
                    "label": "Landmark 7",
                    "value": "98.90614151954651",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=l-kh-id-front-landmark7",
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "idBlurDetection",
            "label": "ID Blur Detection",
            "componentList": [
                {
                    "code": "idBlurDetection",
                    "label": "ID Blur Detection",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "idBrightnessDetc",
            "label": "ID Brightness Detection",
            "componentList": [
                {
                    "code": "idBrightnessDetc",
                    "label": "ID Brightness Detection",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "colorMode",
            "label": "Color Mode",
            "componentList": [
                {
                    "code": "colorMode",
                    "label": "Color Mode",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "screen",
            "label": "Screen Detection",
            "componentList": [
                {
                    "code": "screen",
                    "label": "Screen Detection",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "hologram",
            "label": "Hologram",
            "componentList": [
                {
                    "code": "hologram",
                    "label": "Hologram",
                    "value": "Fail",
                    "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=hologram",
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "substitution",
            "label": "Substitution Checking",
            "componentList": [
                {
                    "code": "substitution",
                    "label": "Substitution Checking",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        },
        {
            "method": "idTamper",
            "label": "ID Tamper Detection",
            "componentList": [
                {
                    "code": "idTamper",
                    "label": "ID Tamper Detection",
                    "value": "Pass",
                    "imageUrl": null,
                    "refImageUrl": null
                }
            ]
        }
    ],
    "outputImageList": [
        {
            "tag": "cropId",
            "imageUrl": "/public/image/v2/c03e4ecb-81aa-4416-83b2-e7a225e7b101?type=cropId"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

```
{
    "apiKey": "apiKey",
    "caseNo": "CASE 123",
    "idImageBase64Image": "/9j/4AAQSkZJ...fYs1wRtQHt//Z\r\n",
    "landmarkCheck": true,
    "idBlurDetection":true,
    "idBrightnessDetection": true,
    "colorMode":true,
    "screenDetection":false,
    "hologram":false,
    "photoSubstitutionCheck":false,
    "fontCheck":false
}
```

{% file src="/files/-MaalKJ4xLOKHw-zyWTa" %}


# Version 1

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/ekyc/v1/doc-verify/kh-id-front`

#### Request Body

| Name               | Type   | Description                   |
| ------------------ | ------ | ----------------------------- |
| caseNo             | string | Reference code given by user  |
| apiKey             | string | To be assigned by Innov8tif   |
| idImageBase64Image | string | Front id card image in base64 |

{% tabs %}
{% tab title="200 " %}

```
{
    "status": "success",
    "messageCode": "api.success",
    "message": "",
    "id": "428d562f-a350-421c-883d-e766a26bde33",
    "methodList": [
        {
            "method": "landmark",
            "label": "Landmark Analysis Result",
            "componentList": [
                {
                    "code": "l-kh-id-front-landmark1",
                    "label": "Landmark 1",
                    "value": "96.24505639076233",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxx?type=l-kh-id-front-landmark1",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark2",
                    "label": "Landmark 2",
                    "value": "95.7434356212616",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-kh-id-front-landmark2",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark3",
                    "label": "Landmark 3",
                    "value": "95.41226029396057",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxx?type=l-kh-id-front-landmark3",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark4",
                    "label": "Landmark 4",
                    "value": "94.89492177963257",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-kh-id-front-landmark4",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark5",
                    "label": "Landmark 5",
                    "value": "94.56592202186584",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxx?type=l-kh-id-front-landmark5",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark6",
                    "label": "Landmark 6",
                    "value": "95.46042084693909",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxx?type=l-kh-id-front-landmark6",
                    "refImageUrl": null
                },
                {
                    "code": "l-kh-id-front-landmark7",
                    "label": "Landmark 7",
                    "value": "95.25001645088196",
                    "imageUrl": "/public/image/v2/xxxxxxxxxxxxxxx?type=l-kh-id-front-landmark7",
                    "refImageUrl": null
                }
            ]
        }
    ],
    "outputImageList": [
        {
            "tag": "cropId",
            "imageUrl": "/public/image/v2/428d562f-a350-421c-883d-e766a26bde33?type=cropId"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Input Example

```
{
    "apiKey": "apiKey",
    "caseNo": "CASE 123",
    "idImageBase64Image": "/9j/4AAQSkZJ...fYs1wRtQHt//Z\r\n" 
}
```

{% file src="/files/-LuotSJXfERDYuqT1Ebv" %}
OkayDoc KH ID Card Front
{% endfile %}


# Recommended Threshold And Sample for Landmarks

### Recommended Threshold

| Item                    | Threshold                                |
| ----------------------- | ---------------------------------------- |
| Landmark 1              | 30                                       |
| Landmark 2              | 30                                       |
| Landmark 3              | 30                                       |
| Landmark 4              | 30                                       |
| Landmark 5              | 30                                       |
| Landmark 6              | 30                                       |
| Landmark 7              | 30                                       |
| ID Blur Detection       | <p>-Pass</p><p>-Cautious</p><p>-Fail</p> |
| ID Brightness Detection | <p>-Pass</p><p>-Fail</p>                 |
| Color Mode              | <p>-Pass</p><p>-Fail</p>                 |
| Screen Detection        | <p>-Pass</p><p>-Cautious</p><p>-Fail</p> |
| Hologram                | <p>-Pass</p><p>-Fail</p>                 |
| Substitution Checking   | <p>-Pass</p><p>-Cautious</p><p>-Fail</p> |
| ID Tamper Detection     | <p>-Pass</p><p>-Fail</p>                 |

### Sample

![Landmark 1](/files/-M62gvIXBwEwyETOrmHX)

![Landmark 2](/files/-M62hACfhGVnHNYOKEmL)

![Landmark 3](/files/-M62hP_d5mh8z_duAmZ_)

![Landmark 4](/files/-M62heRttQlFh3e1Z0iX)

![Landmark 5](/files/-M62i8bONhGeG7ui7DpK)

![Landmark 6](/files/-M62iB7CIj0_hKn78_iz)

![Landmark 7](/files/-M62k5lG3RoMILQfFouE)


# KH - ID Card Back

{% content-ref url="/pages/-MbiX6RvLDIy6alUFlW\_" %}
[Change Log](/okaydoc/cambodia/kh-id-card-back/change-log)
{% endcontent-ref %}

{% content-ref url="/pages/-M5tYLD0Qw4suSusOWFj" %}
[Version 2](/okaydoc/cambodia/kh-id-card-back/version-2)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFmYeInrvTVdWPCqd3" %}
[Version 1](/okaydoc/cambodia/kh-id-card-back/version-1)
{% endcontent-ref %}

{% content-ref url="/pages/-LuFpooyFbN301S7JAu7" %}
[Recommended Threshold And Sample for Landmarks](/okaydoc/cambodia/kh-id-card-back/recommended-threshold-for-landmarks)
{% endcontent-ref %}


# Change Log

## Endpoint Version 2

### Core Version 2.0.1.2

#### **-New Features:**

* Added blurriness detection
* Added brightness detection
* Added color detection

#### **-Bug Fixes:**

NA

**-Enhancements**

NA

## Endpoint Version 1

### Core Version 1.0.1.2

* Created base model




---

[Next Page](/llms-full.txt/1)

