Alien registration card
    • PDF

    Alien registration card

    • PDF

    Article summary

    Available in Classic and VPC

    Recognize and extract key-value input information from alien registration cards using a specialized model engine.

    Request

    This section describes the request format. The method and URI are as follows:

    MethodURI
    POST/id-card

    Request headers

    For information about the headers common to all CLOVA OCR APIs, see CLOVA OCR request headers.

    Request body

    You can include the following data in the body of your request:

    If Content-Type: application/json

    You can include the following data in the body of your request if the request header's Content-Type is application/json:

    FieldTypeRequiredDescription
    versionString-Version information
    • Only use V2
    requestIdStringRequiredRandom API call UUID
    timestampIntegerRequiredRandom API call time (timestamp)
    imagesArrayRequiredimages details

    If Content-Type: multipart/form-data

    You can include the following data in the body of your request if the request header's Content-Type is multipart/form-data:

    FieldTypeRequiredDescription
    messageObjectRequiredRequest data information
    message.versionStringRequiredVersion information
    • Only use V2
    message.requestIdStringRequiredRandom API call UUID
    message.timestampIntegerRequiredRandom API call time (timestamp)
    message.imagesArrayRequiredimages details
    fileFileRequiredOCR recognition image file

    images

    The following describes images.

    FieldTypeRequiredDescription
    formatStringRequiredImage format
    • jpg | jpeg | png | pdf | tif | tiff
      • Image: jpg, jpeg, png
      • Single page: pdf, tif, tiff
    • Select and enter one of the image formats
    nameStringRequiredRandom image name
    • Use to identify images and check response results
    dataStringRequiredBase64-encoded image data
    • Can be entered if Content-Type: application/json

    Request example

    The request example is as follows:

    If Content-Type: application/json

    The request example if the request header's Content-Type is application/json is as follows:

    curl --location --request POST 'https://cbgrx5natw.apigw.ntruss.com/custom/v1/{DomainId}/{InvokeKey}/document/id-card' \
    --header 'Content-Type: application/json' \
    --header 'X-OCR-SECRET: {Secret key issued when registering the app}' \
    --data '{
        "version": "V2",
        "requestId": "string",
        "timestamp": 0,
        "images": [
            { 
                "format": "png", 
                "name": "alienRegistration_test", 
                "data":"{Base64-encoded image data}"
            }
        ]
     }'
    

    If Content-Type: multipart/form-data

    The request example if the request header's Content-Type is multipart/form-data is as follows:

    curl --location --request POST 'https://cbgrx5natw.apigw.ntruss.com/custom/v1/{DomainId}/{InvokeKey}/document/id-card' \
    --header 'X-OCR-SECRET: {Secret key issued when registering the app}' \
    --header 'Content-Type: multipart/form-data' \
    --form 'message="{\"version\": \"V2\", \"requestId\": \"1234\", \"timestamp\": 0, \"images\": [{\"format\": \"png\", \"name\": \"alienRegistration_test\"}]}"' \
    --form 'file=@"{file}"'
    

    Response

    This section describes the response format.

    Response body

    The response body includes the following data:

    FieldTypeRequiredDescription
    versionString-Version information
    • Only use V2
    requestIdString-Random API call UUID
    timestampInteger-API call time (timestamp)
    imagesArray-images details

    images

    The following describes images.

    FieldTypeRequiredDescription
    uidString-Alien registration card image UID
    • Use for API validity checks
    nameString-Alien registration card image name
    • Use to identify images and check response results
    inferResultString-Alien registration card image recognition result
    • SUCCESS | FAILURE | ERROR
      • SUCCESS: recognition successful
      • FAILURE: recognition failure
      • ERROR: recognition processing exception
    messageString-Result message
    validationResultObject-Validity check result information
    validationResult.resultString-Validity check result code
    • NO_REQUESTED | UNCHECKED | ERROR | VALID | INVALID
      • NO_REQUESTED: no validation action requested (validity check failed)
      • UNCHECKED: unable to verify validation
      • ERROR: error on validation (validity check failed)
      • VALID: validation result valid (validity check succeeded)
      • INVALID: failed to pass validation
    validationResult.messageString-Validity check result details message
    • This value is not always returned
    convertedImageInfoObject-Converted image information
    • If format is pdf or tiff
    • Coordinate values are set relative to the called image file
    convertedImageInfo.widthInteger-Converted image width
    convertedImageInfo.heightInteger-Converted image height
    convertedImageInfo.pageIndexInteger-Converted image page index
    idCardObject-ID card details
    idCard.metaObject-Meta information
    idCard.meta.estimatedLanguageString-OCR estimated language
    • ko | en | ja
      • ko:Korean
      • en: English
      • ja: Japanese
    idCard.resultObject-ID card OCR recognition result

    result

    The following describes result.

    FieldTypeRequiredDescription
    isConfidentBoolean-Whether it has details for each type
    • true | false
      • true: has
      • false: doesn't have
    acObject-Alien registration card information
    ac.alienRegNumArray-Alien registration number details
    ac.sexArray-Gender details
    ac.nameArray-Name details
    ac.nationalityArray-Nationality details
    ac.visaTypeArray-Visa type details
    ac.issueDateArray-Issuance date details
    ac.authorityArray-Issuing authority details
    ac.authorityEngArray-Issuing authority English details
    ac.alienRegNumEtcArray-Details other than alien registration number
    roisArray-Object border position information
    idTypeString-ID card type
    • Alien Registration Card

    alienRegNum

    The following describes ac.alienRegNum.

    FieldTypeRequiredDescription
    textString-Recognized number text
    formattedObject-Recognized number text information
    formatted.valueString-Recognized number text value
    keyTextString-Key value of recognized number text
    confidenceScoreFloat-Confidence of recognized number text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    sex

    The following describes ac.sex.

    FieldTypeRequiredDescription
    textString-Recognized gender text
    formattedObject-Recognized gender text information
    formatted.valueString-Recognized gender text value
    keyTextString-Key value of recognized gender text
    confidenceScoreFloat-Confidence of recognized gender text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    name

    The following describes ac.name.

    FieldTypeRequiredDescription
    textString-Recognized name text
    formattedObject-Recognized name text information
    formatted.valueString-Recognized name text value
    keyTextString-Key value of recognized name text
    confidenceScoreFloat-Confidence of recognized name text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    nationality

    The following describes ac.nationality.

    FieldTypeRequiredDescription
    textString-Recognized nationality text
    formattedObject-Recognized nationality text information
    formatted.valueString-Recognized nationality text value
    keyTextString-Key value of recognized nationality text
    confidenceScoreFloat-Confidence of recognized nationality text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    visaType

    The following describes ac.visaType.

    FieldTypeRequiredDescription
    textString-Recognized visa type text
    formattedObject-Recognized visa type text information
    formatted.valueString-Recognized visa type text value
    keyTextString-Key value of recognized visa type text
    confidenceScoreFloat-Confidence of recognized visa type text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    num

    The following describes pp.num.

    FieldTypeRequiredDescription
    textString-Recognized number text
    formattedObject-Recognized number text information
    formatted.valueString-Recognized number text value
    keyTextString-Key value of recognized number text
    confidenceScoreFloat-Confidence of recognized number text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    Date object information

    The following describes the date object.

    FieldTypeRequiredDescription
    textString-Recognized date text
    formattedObject-Recognized date text information
    formatted.yearString-Year (yyyy) of recognized date
    formatted.monthString-Month (MM) of recognized date
    formatted.dayString-Day (dd) of recognized date
    keyTextString-Key value of recognized date text
    confidenceScoreFloat-Confidence of recognized date text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    authority

    The following describes ac.authority.

    FieldTypeRequiredDescription
    textString-Recognized issuing authority text
    formattedObject-Recognized issuing authority text information
    formatted.valueString-Recognized issuing authority text value
    keyTextString-Key value of recognized issuing authority text
    confidenceScoreFloat-Confidence of recognized issuing authority text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    authorityEng

    The following describes ac.authorityEng.

    FieldTypeRequiredDescription
    textString-Recognized issuing authority English text
    formattedObject-Recognized issuing authority text information
    formatted.valueString-Recognized issuing authority text value
    keyTextString-Key value of recognized issuing authority text
    confidenceScoreFloat-Confidence of recognized issuing authority text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    alienRegNumEtc

    The following describes ac.alienRegNumEtc.

    FieldTypeRequiredDescription
    textString-Recognized text
    formattedObject-Recognized text information
    formatted.valueString-Recognized text value
    keyTextString-Key value of recognized text
    confidenceScoreFloat-Confidence of recognized text
    • 0 - 1
    • The higher the confidence value, the more accurate the text is
    boundingPolysArray-boundingPoly details
    maskingPolysArray-maskingPoly details

    rois

    The following describes rois.

    FieldTypeRequiredDescription
    FieldTypeRequiredDescription
    ------------
    xFloat-Object border position X-axis coordinate value
    yFloat-Object border position Y-axis coordinate value

    boundingPolys

    The following describes boundingPolys.

    FieldTypeRequiredDescription
    verticesArray-vertices details

    maskingPolys

    The following describes maskingPolys.

    FieldTypeRequiredDescription
    verticesArray-vertices details

    boundingPolyVertices

    The following describes boundingPolyVertices.

    FieldTypeRequiredDescription
    xFloat-X-axis coordinate value
    yFloat-Y-axis coordinate value

    Response status codes

    For response status codes common to all CLOVA OCR APIs, see Common CLOVA OCR response status codes.

    Response example

    The response example is as follows:

    Success

    The following is a sample response upon a successful call.

    {
        "version": "V2",
        "requestId": "1234",
        "timestamp": 1725415136556,
        "images": [
            {
                "uid": "{uid}",
                "name": "alienRegistration_test",
                "inferResult": "SUCCESS",
                "message": "SUCCESS",
                "validationResult": {
                    "result": "NO_REQUESTED"
                },
                "idCard": {
                    "meta": {
                        "estimatedLanguage": "ko"
                    },
                    "result": {
                        "isConfident": true,
                        "ac": {
                            "alienRegNum": [
                                {
                                    "text": "123***-123****",
                                    "formatted": {
                                        "value": "123***-123****"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 250.44644,
                                                    "y": 86.428566
                                                },
                                                {
                                                    "x": 399.24106,
                                                    "y": 86.428566
                                                },
                                                {
                                                    "x": 399.24106,
                                                    "y": 104.10713
                                                },
                                                {
                                                    "x": 250.44644,
                                                    "y": 104.10713
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 323.0759,
                                                    "y": 84.660706
                                                },
                                                {
                                                    "x": 401.0089,
                                                    "y": 84.660706
                                                },
                                                {
                                                    "x": 401.0089,
                                                    "y": 105.874985
                                                },
                                                {
                                                    "x": 323.0759,
                                                    "y": 105.874985
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "sex": [
                                {
                                    "text": "F",
                                    "formatted": {
                                        "value": "F"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 457.27267,
                                                    "y": 86.69321
                                                },
                                                {
                                                    "x": 491.81177,
                                                    "y": 87.496445
                                                },
                                                {
                                                    "x": 491.4664,
                                                    "y": 102.34618
                                                },
                                                {
                                                    "x": 456.92734,
                                                    "y": 101.542946
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "name": [
                                {
                                    "text": "HONG S*******",
                                    "formatted": {
                                        "value": "HONG S*******"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 250.30173,
                                                    "y": 137.56241
                                                },
                                                {
                                                    "x": 307.85138,
                                                    "y": 136.8519
                                                },
                                                {
                                                    "x": 308.07855,
                                                    "y": 155.25519
                                                },
                                                {
                                                    "x": 250.52892,
                                                    "y": 155.96568
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "nationality": [
                                {
                                    "text": "REPUBLIC OF UTOPIA",
                                    "formatted": {
                                        "value": "REPUBLIC OF UTOPIA"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 251.42857,
                                                    "y": 180.71428
                                                },
                                                {
                                                    "x": 344.24106,
                                                    "y": 180.71428
                                                },
                                                {
                                                    "x": 344.24106,
                                                    "y": 198.88393
                                                },
                                                {
                                                    "x": 251.42857,
                                                    "y": 198.88393
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "visaType": [
                                {
                                    "text": "Corporate investor (D-8)",
                                    "formatted": {
                                        "value": "Corporate investor (D-8)"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 250.44643,
                                                    "y": 225.40178
                                                },
                                                {
                                                    "x": 312.8125,
                                                    "y": 225.40178
                                                },
                                                {
                                                    "x": 312.8125,
                                                    "y": 245.04465
                                                },
                                                {
                                                    "x": 250.44643,
                                                    "y": 245.04465
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "issueDate": [
                                {
                                    "text": "2011.1.1 1234.",
                                    "formatted": {
                                        "year": "2011",
                                        "month": "01",
                                        "day": "01"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 71.69643,
                                                    "y": 292.67856
                                                },
                                                {
                                                    "x": 102.63393,
                                                    "y": 292.67856
                                                },
                                                {
                                                    "x": 102.63393,
                                                    "y": 302.00894
                                                },
                                                {
                                                    "x": 71.69643,
                                                    "y": 302.00894
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 69.91906,
                                                    "y": 290.60785
                                                },
                                                {
                                                    "x": 485.82584,
                                                    "y": 262.38263
                                                },
                                                {
                                                    "x": 486.8961,
                                                    "y": 278.1529
                                                },
                                                {
                                                    "x": 70.989296,
                                                    "y": 306.3781
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "authority": [
                                {
                                    "text": "Director of Seoul Immigration Office",
                                    "formatted": {
                                        "value": "Director of Seoul Immigration Office"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 300.07544,
                                                    "y": 285.12625
                                                },
                                                {
                                                    "x": 492.13126,
                                                    "y": 285.91016
                                                },
                                                {
                                                    "x": 492.02887,
                                                    "y": 310.99646
                                                },
                                                {
                                                    "x": 299.97308,
                                                    "y": 310.21255
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "authorityEng": [
                                {
                                    "text": "CHIEF, SEOUL IMMIGRATION OFFICE",
                                    "formatted": {
                                        "value": "CHIEF, SEOUL IMMIGRATION OFFICE"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 302.00894,
                                                    "y": 308.88394
                                                },
                                                {
                                                    "x": 338.3482,
                                                    "y": 308.88394
                                                },
                                                {
                                                    "x": 338.3482,
                                                    "y": 321.1607
                                                },
                                                {
                                                    "x": 302.00894,
                                                    "y": 321.1607
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": []
                                }
                            ],
                            "alienRegNumEtc": [
                                {
                                    "text": "B4***",
                                    "formatted": {
                                        "value": "B4***"
                                    },
                                    "keyText": "",
                                    "confidenceScore": 0.0,
                                    "boundingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 128.6607,
                                                    "y": 292.67853
                                                },
                                                {
                                                    "x": 160.58034,
                                                    "y": 292.67853
                                                },
                                                {
                                                    "x": 160.58034,
                                                    "y": 301.51782
                                                },
                                                {
                                                    "x": 128.6607,
                                                    "y": 301.51782
                                                }
                                            ]
                                        }
                                    ],
                                    "maskingPolys": [
                                        {
                                            "vertices": [
                                                {
                                                    "x": 127.77678,
                                                    "y": 291.7946
                                                },
                                                {
                                                    "x": 161.46426,
                                                    "y": 291.7946
                                                },
                                                {
                                                    "x": 161.46426,
                                                    "y": 302.40176
                                                },
                                                {
                                                    "x": 127.77678,
                                                    "y": 302.40176
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        "rois": [
                            {
                                "vertices": [
                                    {
                                        "x": 11.189065,
                                        "y": 9.545465
                                    },
                                    {
                                        "x": 537.28156,
                                        "y": 9.624473
                                    },
                                    {
                                        "x": 538.10034,
                                        "y": 341.7781
                                    },
                                    {
                                        "x": 11.295485,
                                        "y": 342.03995
                                    }
                                ]
                            }
                        ],
                        "idtype": "Alien Registration Card"
                    }
                }
            }
        ]
    }
    

    Failure

    The following is a sample response upon a failed call.

    {
        "version": "V2",
        "requestId": "1234",
        "timestamp": 1725235840459,
        "images": [
            {
                "uid": "{uid}",
                "name": "alienRegistration_test",
                "inferResult": "ERROR",
                "message": "Read page:0 error.",
                "validationResult": {
                    "result": "NO_REQUESTED"
                }
            }
        ]
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.