• About TrustVision
  • Android SDK
  • iOS SDK
  • Flutter SDK
  • React Native SDK
  • Web SDK
  • API Client Libraries
  • eKYC Platform
  • TS eKYC/FA App
TrustVision API Documentation

eKYC Platform Integration Guidelines

Prerequisites

Our client will be provided following credentials to initialize a unique token for an user flow:

I. Generate token to send to eKYC Platform

Reference Authencation mechanism

II. Integrate with your platform

II.1 Web or WebView

Use EncodedBase64Token generated from step I and concatenate to provided URL

Final URL:

II.2 Android

II.2.1 eKYC Platform

Refer to this for more details.

II.2.2 eKYC Platform Webview

Refer to this for more details.

II.3 iOS

II.3.1 eKYC Platform

Refer to this for more details.

II.3.2 eKYC Platform Webview

Refer to this for more details.

II.4 Flutter

II.5 React Native

III. How client will get the result

III.1 Use callback URL

  • Use-case: TrustingSocial's Backend call to Client's Backend.
  • The result will be sent to the client's callback URL in JSON format.
  • The client should verify the signature that was signed using the TS RSA key.

Sample result:

json
{
  "verdict": "pending|approve|review|reject",
  "signature": "ImFwcGxpY2F0aW9uX3VuaXF1ZV90b2tlbvN4A6zZUr3SAg7mH6vUiypRRhbCsyoVU9E2/ZFQywpPTcQ2tUC3i66jy85yjwL4XDiaEgQBJh9ZzOQAl8vKbo2cH/rVkOJYQR8HLOE5yeBhHFk9xKVfMyywtXwpaHkMH+U7AWUqPvyYnRMfHC3Pgx/V3npDvDrRSMpRLe9pAKw+1GSrGnw+wY7eTHVWeo6ilQnJ3r8nSI4yZGxnoUpffQenW8tPYuRYJuODUiXochsm408oSIzyZCvyPWkTCso93P2xnEshgMbHkqyTGUeOoePdJT9Z3OolbZbkqyEbQ==",
  "application_id": 10,
  "application_unique_token": "ad083945-9620-486c-be7d-c3f5dab870a1",
  "application_user_id": "01234567889",
  "file_ids": {
    "gesture_images": [
      {
        "gesture": "frontal",
        "image_id": "fa9a4fee-41c3-4988-a126-1431c130aa94"
      },
      {
        "gesture": "frontal",
        "image_id": "3b02828e-1d99-4bfc-9b9c-8aec102a315d"
      }
    ],
    "id_back_img_uuid": "93cef1cd-2782-4264-9c65-cce78ce3f549",
    "id_front_img_uuid": "8fdcb17e-5d41-4814-8d4f-8c1bfb51df20",
    "liveness_transformed_video_id": "b5a23e55-773f-4cf2-985b-835b9b3d0077",
    "qr1_img_uuid": "",
    "selfie_image_uuid": "3b02828e-1d99-4bfc-9b9c-8aec102a315d",
    "sequence_frames": [
      {
        "file_id": "4591fd8b-578f-422f-92d4-3e54a66837d5",
        "file_size": 480965
      },
      {
        "file_id": "32e870ca-816f-46c0-b303-98bb89173843",
        "file_size": 486082
      },
      {
        "file_id": "078765c1-9e55-4740-a0fe-60b05ed2f348",
        "file_size": 487386
      },
      {
        "file_id": "5e129fb2-8c41-4e23-959b-958e607092c7",
        "file_size": 146095
      }
    ]
  },
  "ekyc_face": {
    "compare_score": 0.699894,
    "compare_status": "matched",
    "liveness_score": 0.99999946,
    "liveness_status": "success",
    "process_status": "success",
    "processed_at": "2024-09-26T18:11:54+07:00",
    "sanity_check_result": "good",
    "sanity_check_score": 1,
    "sanity_check_status": "success",
    "search_face_result": {
      "faces": [
        {
          "id_number": "3129326470849810",
          "image_id": "7db53bf6-2b20-45d0-a2c3-eaf63b142d9e",
          "metadata": {
            "phone_number": "",
            "unique_token": "UiZW2HrO"
          },
          "score": 0.86089295
        }
      ],
      "response": {
        "faces": [
          [
            {
              "id": "95e4db8d-448c-4a64-8799-b9701b08358c",
              "image_id": "7db53bf6-2b20-45d0-a2c3-eaf63b142d9e",
              "metadata": [
                {
                  "confidence_score": 0,
                  "confidence_verdict": "",
                  "field": "national_id",
                  "value": "3129326470849810"
                },
                {
                  "confidence_score": 0,
                  "confidence_verdict": "",
                  "field": "phone_number",
                  "value": ""
                },
                {
                  "confidence_score": 0,
                  "confidence_verdict": "",
                  "field": "unique_token",
                  "value": "UiZW2HrO"
                }
              ],
              "score": 0.86089295
            }
          ]
        ],
        "request_id": "3cf7723d-f13b-49a0-95f8-7e2e5f8f62fa",
        "status": "success"
      }
    },
    "search_face_status": "found"
  },
  "ekyc_ocr": {
    "card_info": {
      "card_info": [
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "crn",
          "value": "0123456789"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "last_name",
          "value": "SANTOS"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "first_name",
          "value": "JOSE"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "middle_name",
          "value": "CRUZ"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "date_of_birth",
          "value": "1990/01/01"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "gender",
          "value": "F"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "address",
          "value": "CABAROAN SAN ESTEBAN ILOCOS SUR PHL 2706"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "id",
          "value": "0123456789"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "card_type",
          "value": "ph.ump"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "card_label",
          "value": "ph.ump.front"
        },
        {
          "confidence_score": 0,
          "confidence_verdict": "",
          "field": "name",
          "value": "JOSE CRUZ SANTOS"
        }
      ],
      "converted_card_info": {
        "address": "CABAROAN SAN ESTEBAN ILOCOS SUR PHL 2706",
        "birth_date": "1990/01/01",
        "card_label": "ph.ump.front",
        "card_type": "ph.ump",
        "gender": "F",
        "id_number": "0123456789",
        "name": "JOSE CRUZ SANTOS"
      }
    },
    "process_status": "success",
    "processed_at": "2024-09-26T18:11:29+07:00",
    "sanity_check_result": "good",
    "sanity_check_score": 1,
    "sanity_check_status": "success",
    "search_face_result": null,
    "search_face_status": "disabled"
  },
  "form_data": {
    "contactInfo": {
      "familyAddress": "CABAROAN SAN ESTEBAN ILOCOS SUR PHL 2706"
    },
    "personalInfo": {
      "birthday": "1990/01/01",
      "fullName": "JOSE CRUZ SANTOS",
      "gender": "",
      "idCard": "0123456789"
    }
  },
  "id_tampering": {
    "score": 1,
    "verdict": "good"
  },
  "time": "2024-09-27T09:50:32+07:00"
}

Explanation of the fields:

Field nameDatatypeDescription
application_idintApplication ID returned by TV, can be used to get application detail later
application_unique_tokenstringthe unique token for User Session, generated after decrypting the client's encrypted token
application_user_idstringthe decrypted client-generated user ID
file_idsobjectContains images, frame video, merged video.
ekyc_faceobjectFace image processing results including: sanity check, liveness check, comparison (with ID card face), searching
ekyc_ocrobjectID Card image processing result including: sanity check, card info, search faces
form_dataobjectThe user-filled form
id_tamperingobjectID card tampering check
verdictstringReference
timestringThe time of the message
All the score fieldsfloat/decimalDecimal number between 0 and 1 inclusively

How to verify signature from JSON data:

- Public key:

Philippines environment:

json
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwC4C2c+nbI5GN3RseYUE
6xB1SObAk1HNFrs41sbBL1ZgMcYmXnuPrqXehzdqbBSYnWwFufLwFnFfAox7dInw
2olB8QCX9aOYXxcCX+T4JKJxYMuMC7+vuKVip22U+6WUTOaHqGAB2ZmsGPp7dpN4
Q+5duwiYam4izHwiFZ2bGmXbDqARtRlO+UnA8JMVE9LISQD1p238Id+AY3K9W8GQ
W3luLJttKZ0/ulJ54JsVxg5wF3EtohfcvVSJD/6rY0BLUINB5o9nLuGYkjpd+7V0
oB+o4YDMPMOTu8IJa0tbZg8HClr+/Rq3W4xle/NFS1YbLmp45MJ8APsbX9OkG+jM
JwIDAQAB
-----END PUBLIC KEY-----

- To verify the received data, follow these steps:

  1. Extract the signature: Isolate the value of the signature field from the received JSON data.
  2. Prepare the data payload: Create a representation of the JSON data excluding the signature field. This is the original data that was signed.
  3. Verify the signature: Using the public key, verify the extracted signature (from step 1) against the prepared data payload (from step 2).

Sample code:

Reference:

III.2 Call HTTP Request

  • Use-case: Client's Backend call to TrustingSocial's Backend.
  • The client use the API Application Detail to get the user flow result.

III.3 Redirect URL

  • Use-case: TrustingSocial's Website redirect to Client's Website.
  • After the user finishes, they can be redirected to a URL you provide. Your backend can then call our API to retrieve the results. See details III.2