# Versions

## 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<mark style="color:red;">\*</mark> | string | Front id card/passport image in base64                       |
| apiKey<mark style="color:red;">\*</mark>            | 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" %}
{% code title="Response Code Block" %}

```
{
    "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"
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Postman Collection

{% file src="<https://1723857616-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoP1M8bTYgFFHHnAdjjta%2Fuploads%2FXRvam0aj1fg2bcT8sUXw%2FOkayID%20v3.postman_collection.rar?alt=media&token=3106fae8-f88f-435d-9f26-0e79dce9189d>" %}
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 %}

#### Postman Collection

{% file src="<https://1723857616-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoP1M8bTYgFFHHnAdjjta%2Fuploads%2FcvDm4u68PSeCukVALNVR%2FOkayID-%20OCR.postman_collection.rar?alt=media&token=6056524c-5457-422e-8c82-f3009afabbb7>" %}
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 %}

#### Postman Collection&#x20;

{% file src="<https://1723857616-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoP1M8bTYgFFHHnAdjjta%2Fuploads%2Fr83bRBv15jpKjQ8fhAgG%2FOkayID%20v1.postman_collection.rar?alt=media&token=4de06b27-f50c-4a23-9a05-3957753c1ce8>" %}
OkayID v1
{% endfile %}
