# Centralized OkayID

## **Overview**

The user will need to provide the input *(input 2 in the* [*flow chart*](/emas-ekyc-portal.md#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>](/emas-ekyc-portal/image-requirement/okayid.md) 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="/files/Hi019Wb5Q9QFFr7gJOTg" 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>](/emas-ekyc-portal/image-requirement/okayid.md)" 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](broken://pages/x0g3YpCYXnwaikNluEAW) 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api2-ekycportal.innov8tif.com/emas-ekyc-portal/centralized-okayid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
