Introduction
The eKYC module is an Fcloud service developed by Ftech. The module allows customer identity verification through the application of electronic technology. To integrate and use this service, you must use Fcloud's SDK. And here are instructions for integrating the SDK.
Authentication
To call the APIs, we will have to init the SDK with the parameters ClientID and SecretKey taken when you create the Application on CMS for partners according to the following instructions:
- Log in to CMS Partner with the username/password provided (https://fcloud-partner-cms.ftech.ai)
 
- Buy a service package
 
- Create App
 
Server Integrator
After integrating the SDK, the Fcloud service supports server-server callbacks to help get request information as quickly and accurately as possible.

Web SDK
Android SDK
Install SDK Android
Setup gradle maven
- With Gradle v1.x - v5.x
Open build.gradefile and addmavenline like below
allprojects {
    repositories {
        google()  
        mavenCentral()
        maven { url 'https://jitpack.io' } <- // add this line
    }
}
- With Gradle v6.x+
Open setting.gradlefile and addmavenline like below
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' } <- // add this line
    }
}
Open file app/build.grade then add sdk
dependencies {
...
   implementation "com.github.ftechmobile:feykc-android:1.0.1"
}
Init in file Application
override fun onCreate() {
        super.onCreate()
        ...
        FTechEkycManager.init(this)
    }
SDK Android Integration
Init
| Param | Type | Description | 
|---|---|---|
| appId | String | Application id | 
| secretKey | String | IOE secret key | 
- After successful initial, the SDK returns a status resulting in the onSuccess()callback. Handling of successful initial here.
- When initial fails, it will be processed at callback onFail().
FTechEkycManager.registerEkyc(appId, licenseKey, new IFTechEkycCallback<Boolean>() {
            @Override
            public void onSuccess(Boolean info) {
            }
            @Override
            public void onFail(APIException error) {
            }
            @Override
            public void onCancel() {
            }
        });
Register callback
Calling functions in activity lifecycle
    @Override
    protected void onResume() {
        super.onResume();
        FTechEkycManager.notifyActive(this);
    }
    @Override
    protected void onPause() {
        super.onPause();
        FTechEkycManager.notifyInactive(this);
    }
SDK Android Feature
Create transaction
- Used to create transaction for Ekyc execution session
- When successful transaction creation, the SDK returns a model transaction data which leads to the onSuccess()callback
- When creating transaction fails, it will be processed at callback onFail()
FTechEkycManager.createTransaction(new IFTechEkycCallback<TransactionData>() {
            @Override
            public void onSuccess(TransactionData info) {
            }
            @Override
            public void onFail(APIException error) {
            }
            @Override
            public void onCancel() {
            }
        });
Get process transaction
- Used to get the Ekyc process of a transaction
- When the get process transaction is successful, the SDK returns a model process transaction data resulting in the onSuccess()callback
- When get process transaction fails, it will be processed at callback onFail()
| Param | Type | Description | 
|---|---|---|
| transactionId | String | Transaction id | 
FTechEkycManager.getProcessTransaction(transactionId, new IFTechEkycCallback<TransactionProcessData>() {
            @Override
            public void onSuccess(TransactionProcessData info) {
            }
            @Override
            public void onFail(APIException error) {
            }
            @Override
            public void onCancel() {
            }
        });
Upload Photo (Normal detection)
- Used to upload photos of documents, face for Ekyc
- When the photo upload is successful, the SDK returns a model capture data resulting in the onSuccess()callback
- When uploading photo fails, it will be handled at callback onFail()
| Param | Type | Description | 
|---|---|---|
| pathImage | String | Image path local | 
| captureType | CAPTURE_TYPE | Orientation images include the following types: CAPTURE_TYPE.FRONT, CAPTURE_TYPE.BACK, CAPTURE_TYPE.FACE | 
FTechEkycManager.uploadPhoto(pathImage, captureType, new IFTechEkycCallback<CaptureData>() {
            @Override
            public void onSuccess(CaptureData info) {
            }
            @Override
            public void onFail(APIException error) {
            }
            @Override
            public void onCancel() {
            }
        });
Face Matching
Use this method to get ORC scan information
- Use this method to get ORC scan information
- When face matching is successful, the SDK returns a model face matching data resulting in the onSuccess()callback
- When face matching fails, it will be handled at the callback onFail()
FTechEkycManager.faceMatching(new IFTechEkycCallback<FaceMatchingData>() {
           @Override
           public void onSuccess(FaceMatchingData info) {
           }
           @Override
           public void onFail(APIException error) {
           }
           @Override
           public void onCancel() {
           }
       })
FaceMatchingData
| Param | Type | Description | 
|---|---|---|
| sessionId | String | Session id | 
| cardInfo | CardInfo | Card information | 
CardInfo
| Param | Type | Description | 
|---|---|---|
| id | String | id card | 
| birthDay | String | birth day | 
| birthPlace | String | birth place | 
| cardType | String | card type | 
| gender | String | gender | 
| issueDate | String | issue date | 
| issuePlace | String | issue place | 
| name | String | full name | 
| nationality | String | nationality | 
| originLocation | String | origin location | 
| passportNo | String | passport no | 
| recentLocation | String | recent location | 
| validDate | String | valid date | 
| feature | String | feature | 
| nation | String | nation | 
| mrz | String | mrz | 
Liveness detection
Using bitmap image to check face position
- For enable/disable liveness detection, use this:
FTechEkycManager.setEnableLiveness(true);
FTechEkycManager.detectFacePose(bitmap, FACE_POSE.UP, new IFTechEkycCallback<Boolean>() {
            @Override
            public void onSuccess(Boolean info) {
            }
            @Override
            public void onFail(APIException error) {
            }
            @Override
            public void onCancel() {
            }
        });
Submit info
Use this method to submit information
- After submitting the info successfully, the SDK returns a status leading to the onSuccess()callback
- When submitting information fails, it will be handled at the callback onFail()
FTechEkycManager.submitInfo(submitInfoRequest, new IFTechEkycCallback<Boolean>() {
           @Override
           public void onSuccess(Boolean info) {
           }
           @Override
           public void onFail(APIException error) {
           }
           @Override
           public void onCancel() {
           }
       });
NewSubmitInfoRequest
| Param | Type | Description | 
|---|---|---|
| cardInfoSubmit | CardInfoSubmit | Information card | 
| preProcessId | String | Session id | 
CardInfoSubmit
| Param | Type | Description | 
|---|---|---|
| id | String | id card | 
| birthDay | String | birth day | 
| birthPlace | String | birth place | 
| cardType | String | card type | 
| gender | String | gender | 
| issueDate | String | issue date | 
| issuePlace | String | issue place | 
| name | String | full name | 
| nationality | String | nationality | 
| originLocation | String | origin location | 
| passportNo | String | passport no | 
| recentLocation | String | recent location | 
| validDate | String | valid date | 
| feature | String | feature | 
| nation | String | nation | 
| mrz | String | mrz | 
IOS SDK
Install SDK IOS
Add package dependencies
https://github.com/FTechMobile/fekyc
SDK IOS Integration
Register callback
    FEKYCApp.instance().delegate = self
And implement FEKYCDelegate
Init
| Param | Type | Description | 
|---|---|---|
| appId | String | Ekyc app id | 
| licenseKey | String | Ekyc license key | 
- Upon successful registration, the SDK returns a status resulting in the registerEkycSuccess()callback. Handling of successful registration here.
- When register fails, it will be processed at callback ekycFailure().swift FEKYCApp.instance().registerEkyc(licenseKey, appID)
SDK IOS Feature
Enable Liveness version
    FEKYCApp.setEnableLiveness()
Use full stream sdk
    FEKYCApp.instance().start()
Note: If you don't want to use enough threads, the SDK provides the following features
Create transaction
- Used to create transaction for Ekyc execution session
- When successful transaction creation, the SDK returns a model transaction data which leads to the creatTransactionSuccess()callback. Handling create transaction successfully here.
- When creating transaction fails, it will be processed at callback ekycFailure().
    FEKYCApp.instance().createTransaction()
Get process transaction
- Used to get the Ekyc process of a transaction
| Param | Type | Description | 
|---|---|---|
| transactionId | String | Transaction id | 
    FEKYCApp.instance().getProcessTransaction(transactionId)
Upload Photo
- Used to upload photos of documents, face for Ekyc
| Param | Type | Description | 
|---|---|---|
| pathImage | String | Image path local | 
| step | FEKYCStep | Verify steps | 
- When the photo upload is successful, the SDK returns a model capture data resulting in the uploadPhotoSuccess()callback. Handling photo upload successfully here.
- When uploading photo fails, it will be handled at callback ekycFailure().swift FEKYCApp.instance().uploadPhoto(step: FEKYCStep, imageFile: imageFile)
Face Matching
- Use this method to get ORC scan information & check matching face from upload photo
- When face matching is successful, the SDK returns a model face matching data resulting in the faceMatchingSuccess()callback. Handling face matching successfully here.
     FEKYCApp.instance().faceMatching()
FaceMatchingData
| Param | Type | Description | 
|---|---|---|
| sessionId | String | Session id | 
| cardInfo | CardInfo | Card information | 
CardInfo
| Param | Type | Description | 
|---|---|---|
| id | String | id card | 
| birthDay | String | birth day | 
| birthPlace | String | birth place | 
| cardType | String | card type | 
| gender | String | gender | 
| issueDate | String | issue date | 
| issuePlace | String | issue place | 
| name | String | full name | 
| nationality | String | nationality | 
| originLocation | String | origin location | 
| passportNo | String | passport no | 
| recentLocation | String | recent location | 
| validDate | String | valid date | 
| feature | String | feature | 
| nation | String | nation | 
| mrz | String | mrz | 
Submit info
- Use this method to submit information & finish ekyc session
- After submitting the info successfully, the SDK returns a status leading to the didEkycSuccess()callback. Handling submit info successfully here.
    FEKYCApp.instance().submitInfo(info: FaceMatchingData)
Errors
The Kittn API uses the following error codes:
| Error Code | Meaning | 
|---|---|
| 400 | Bad Request -- Your request is invalid. | 
| 401 | Unauthorized -- Your API key is wrong. | 
| 403 | Forbidden -- The kitten requested is hidden for administrators only. | 
| 404 | Not Found -- The specified kitten could not be found. | 
| 405 | Method Not Allowed -- You tried to access a kitten with an invalid method. | 
| 406 | Not Acceptable -- You requested a format that isn't json. | 
| 429 | Too Many Requests -- You're requesting too many kittens! Slow down! | 
| 500 | Internal Server Error -- We had a problem with our server. Try again later. | 
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. | 
 
      