# Centralized OkayID

## **Overview**

The user will need to provide the input *(input 2 in the* [*flow chart*](https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/..#our-ekyc-apis-process-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 for the user to check on the extracted information.&#x20;

The API will also return cropped ID cards from the submitted image and cropped portraits from the ID card.  Users will also need to follow a set of rules that can be found [<mark style="color:orange;">here</mark>](https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/image-requirement/okayid) to make sure the result is accurate.

#### Steps:

1. User will need to use the JourneyId gotten from the previous API (Create JourneyId)
2. Place the JourneyId and the content for the respective data in the [API Method](#api-method) by following the [Example](#input-example).
3. The parameter descriptions can be found in the [API Method](#api-method) after expansion.
4. The average processing time is about 5 to 10 seconds.

## Important Note

1. Please take note that <mark style="color:red;">**^**</mark> will be part of the response from OkayID API.&#x20;
   * <mark style="color:red;">**^**</mark> indicates a NEW LINE.&#x20;
   * e.g. Name from Malaysia - MyKad

<figure><img src="https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2FcYu1GDhbAUV2homKeRWp%2Fname%20with%20special.JPG?alt=media&#x26;token=ac98dfa0-247a-46b4-a0de-a0242cc956c7" alt=""><figcaption></figcaption></figure>

2. **Basic Validation Rule**&#x20;

<table><thead><tr><th width="129">Country</th><th width="123">Document Type</th><th width="109">Region</th><th width="104">Field Type</th><th>Validation Rule</th></tr></thead><tbody><tr><td>Malaysia</td><td>MyKad, MyKas,MyTentera, MyPR, MyKid</td><td>ID Number</td><td>2</td><td>Must be 12 digits</td></tr><tr><td>Malaysia</td><td>MyKad, MyKas,MyTentera, MyPR, MyKid</td><td>Name</td><td>25</td><td>1) Numeric is not allow<br>2) Special Character ONLY allow <strong>/.@'^()</strong></td></tr><tr><td>Malaysia</td><td>MyKad, MyKas,MyTentera, MyPR, MyKid</td><td>DOB</td><td>5</td><td>1) Day from 0 - 31<br>2) Month from 0 - 12<br>3) Between Year from 1900 - 2100</td></tr></tbody></table>

{% hint style="info" %}
Please refer to the "[<mark style="color:orange;">Image Requirement</mark>](https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/image-requirement/okayid)" section to get the best result for each API return
{% endhint %}

## API Method

<mark style="color:green;">`POST`</mark> `https://ekycportaldemo.innov8tif.com/api/ekyc/okayid`

#### Request Body

| Name                                                | Type    | Description                                                                                            |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| docTypeEnabled                                      | boolean | Set to True - document type will be returned                                                           |
| backImage                                           | string  | Back id card image in base64                                                                           |
| cambodia                                            | boolean | Set to True if it is Cambodia ID Card                                                                  |
| faceImageEnabled                                    | boolean | Set to True - Cropped face image will be returned                                                      |
| imageEnabled                                        | boolean | Set to True  - Cropped document image will be returned                                                 |
| imageFormat                                         | string  | Set to JPG, JPEG, PNG, BMP, GIF, TIFF, TIF depending of the image format OR leave it blank if not sure |
| base64ImageString<mark style="color:red;">\*</mark> | string  | Front id card/passport image  in base64                                                                |
| journeyId<mark style="color:red;">\*</mark>         | string  | Retrieve from 'Create JourneyID' API                                                                   |

{% tabs %}
{% tab title="200 Successfully response to the user" %}
{% code title="Response Code Block" %}

```
{
    "status": "success",
    "message": "",
    "result": [
        {
            "ListVerifiedFields": {
                "pFieldMaps": [
                    {
                        "wLCID": 0,
                        "FieldType": 1,
                        "wFieldType": 1,
                        "Field_MRZ": null,
                        "Field_Visual": "MYS",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 2,
                        "wFieldType": 2,
                        "Field_MRZ": null,
                        "Field_Visual": "861200556488",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 1086,
                        "FieldType": 71172108,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "PEREMPUAN",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 12,
                        "wFieldType": 12,
                        "Field_MRZ": null,
                        "Field_Visual": "F",
                        "Field_Barcode": null,
                        "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",
                        "Field_Barcode": null,
                        "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",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 38,
                        "wFieldType": 38,
                        "Field_MRZ": null,
                        "Field_Visual": "Malaysia",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 57,
                        "wFieldType": 57,
                        "Field_MRZ": null,
                        "Field_Visual": "8612005564880202",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    },
                    {
                        "wLCID": 0,
                        "FieldType": 433,
                        "wFieldType": 433,
                        "Field_MRZ": null,
                        "Field_Visual": "WARGANEGARA",
                        "Field_Barcode": null,
                        "Matrix": [
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0,
                            0
                        ]
                    }
                ]
            }
        }
    ],
    "documentType": "Malaysia - Id Card #2"
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Failed to response to the user" %}
{% code title="Response Code Block" %}

```javascript
{
    "status": "error"
}
```

{% endcode %}
{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}
{% code title="Response Code Block" %}

```javascript
{
    status:"Internal Server Error"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Please refer to this [Page](https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/broken-reference) for input example
{% endhint %}

### Input Example

{% code title="Request Code Block" %}

```
{
    "journeyId":"7851b4e3-df09-4ab6-8091-xxxxxxxxxx",
    "base64ImageString": "",
    "backImage": "",
    "imageFormat":"",
    "imageEnabled":false,
    "faceImageEnabled":false,
    "docTypeEnabled":true
    "cambodia":false
}
```

{% endcode %}

{% hint style="info" %}
This input example is based on the default use case
{% endhint %}

#### Postman Collection

{% hint style="info" %}
Get the Postman Collection\
<https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/postman-collection>
{% endhint %}
