Data retrieval methods
This document describes two methods to retrieve eKYC data from the FPT AI eKYC system. These methods can be used to get data from the system after the eKYC steps have been performed.
1. Retrieving callback data from the FPT AI eKYC system
After completing an eKYC session, the FPT AI eKYC system will send the eKYC data to the customer's system via a callback URL that the customer has provided in the Data retrieve configuration on the eKYC Portal. This data includes information such as status codes, error messages (if any), and other information related to the eKYC session.
1.1. Request sample
curl --location --request POST 'your-url' \
--header 'your-key: your-value' \
--data-raw ekyc_data
1.2. Data callback sample
{
    "uuid": "your-uuid",
    "code": "303",
    "message": "face is not matching with document",
    "ocr": {
        "code": "200",
        "message": "ocr successful",
        "data": [
            {
                "id": "0xxxxxxxxx9",
                "id_prob": "98.66",
                "name": "Nguyễn Văn A",
                "name_prob": "99.09",
                "dob": "dd/mm/yyyy",
                "dob_prob": "98.41",
                "sex": "NAM",
                "sex_prob": "98.30",
                "nationality": "VIỆT NAM",
                "nationality_prob": "99.77",
                "type_new": "cccd_12_front",
                "doe": "dd/mm/yyyy",
                "doe_prob": "98.93",
                "home": "Xã V, Huyện M, NAM ĐỊNH",
                "home_prob": "96.54",
                "address": "Xã V, Huyện M, NAM ĐỊNH",
                "address_prob": "98.27",
                "address_entities": {
                    "province": "NAM ĐỊNH",
                    "district": "Huyện V",
                    "ward": "Xã V",
                    "street": ""
                },
                "overall_score": "99.47",
                "type": "new",
                "QRcode": "N/A"
            },
            {
                "ethnicity": "N/A",
                "ethnicity_prob": "N/A",
                "religion": "N/A",
                "religion_prob": "N/A",
                "features": "SẸO CHẤM",
                "features_prob": "99.78",
                "issue_date": "dd/mm/yyyy",
                "issue_date_prob": "99.31",
                "type_new": "new_back",
                "issue_loc": "CỤC TRƯỞNG CỤC CẢNH SÁT QUẢN LÝ HÀNH CHÍNH VỀ TRẬT TỰ XÃ HỘI",
                "issue_loc_prob": "95.70",
                "overall_score": "98.61",
                "type": "new_back",
                "mrz": "N/A",
                "mrz_prob": "N/A"
            }
        ]
    },
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3435",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "303",
        "message": "face is not matching with document",
        "isMatch": "false",
        "similarity": "49.09",
        "warning": "N/A"
    },
    "resources": {
        "front": "url-front",
        "back": "url-back",
        "video": "url-video"
    }
}
2. Get eKYC data from API
Base URL
- 
Production: https://api.fpt.ai/vision/ekyc-be
 
2.1. Request Url
POST base_url/callback/get_result
2.2. Request Headers
| Parameter | Required | Data type | Description | Note | 
|---|---|---|---|---|
| api-key | Yes | String | Your API key to authorize to the system of FPT AI eKYC | |
| uuid | Yes | String | client_uuid generated by customer's system in the session initialization step | 
2.3. Request sample
curl --location --request POST 'base_url/callback/get_result' \
--header 'api-key: your-api-key' \
--header 'uuid: your-uuid'
2.4. Response
- Succeeded: http_code = 
200 
{
    "uuid": "your-uuid",
    "code": "303",
    "message": "face is not matching with document",
    "ocr": {
        "code": "200",
        "message": "ocr successful",
        "data": [
            {
                "id": "0xxxxxxxxx9",
                "id_prob": "98.66",
                "name": "Nguyễn Văn A",
                "name_prob": "99.09",
                "dob": "dd/mm/yyyy",
                "dob_prob": "98.41",
                "sex": "NAM",
                "sex_prob": "98.30",
                "nationality": "VIỆT NAM",
                "nationality_prob": "99.77",
                "type_new": "cccd_12_front",
                "doe": "dd/mm/yyyy",
                "doe_prob": "98.93",
                "home": "Xã V, Huyện M, NAM ĐỊNH",
                "home_prob": "96.54",
                "address": "Xã V, Huyện M, NAM ĐỊNH",
                "address_prob": "98.27",
                "address_entities": {
                    "province": "NAM ĐỊNH",
                    "district": "Huyện V",
                    "ward": "Xã V",
                    "street": ""
                },
                "overall_score": "99.47",
                "type": "new",
                "QRcode": "N/A"
            },
            {
                "ethnicity": "N/A",
                "ethnicity_prob": "N/A",
                "religion": "N/A",
                "religion_prob": "N/A",
                "features": "SẸO CHẤM",
                "features_prob": "99.78",
                "issue_date": "dd/mm/yyyy",
                "issue_date_prob": "99.31",
                "type_new": "new_back",
                "issue_loc": "CỤC TRƯỞNG CỤC CẢNH SÁT QUẢN LÝ HÀNH CHÍNH VỀ TRẬT TỰ XÃ HỘI",
                "issue_loc_prob": "95.70",
                "overall_score": "98.61",
                "type": "new_back",
                "mrz": "N/A",
                "mrz_prob": "N/A"
            }
        ],
        "warning_data": [
            {
              "warning_code": "E30",
              "warning_message": "Front side and back side are not from the same card",
              "prediction_result": 1,
              "risk_level": 1,
              "confident_score": "N/A",
              "count": 1
            }
        ]
    },
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3435",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "303",
        "message": "face is not matching with document",
        "isMatch": "false",
        "similarity": "49.09",
        "warning": "N/A"
    },
    "resources": {
        "front": "url-front",
        "back": "url-back",
        "video": "url-video"
    },
    "kyc_conclusion": {
        "decision": 2,
        "decision_message": "NEED_REVIEW",
        "risk_level": 1,
        "rule_table": [
            {
                "risk_level": 1,
                "group_code": "FC",
                "group_name": "ID Fraud Check",
                "rules": [
                    {
                        "warning_code": "FC03",
                        "warning_message": "Document has been edited or is colored photocopy",
                        "prediction_result": 1,
                        "risk_level": 1,
                        "confident_score": "0.8",
                        "count": 1
                    },
                ]
            },
            {
                "risk_level": 1,
                "group_code": "QC",
                "group_name": "ID Quality Check",
                "rules": [
                    {
                        "warning_code": "QC01",
                        "warning_message": "Image resolution is too low",
                        "prediction_result": 1,
                        "risk_level": 1,
                        "confident_score": "N/A",
                        "count": 2
                    },
                ]
            }
        ],
        "ocr_retry": 4,
        "face_retry": 3
    },
}
- 
Failed: For example
- 
http_code =
403{
"message": "Forbidden"
} - 
http_code =
404{
"message": "Not found data with uuid"
} 
 -