• Overview
  • eKYC Platform
  • Face Authentication
  • Vision Score
  • Behavioral Biometric (BehavioIQ)
  • SIM Verification
  • Mule Account Database
  • eKYC Core
  • Demo Apps
TrustVision API Documentation

SIM Verification API

SIM Verification confirms a customer's ownership of a phone number, and surfaces telco-held information about that SIM for verification purposes. The typical flow is an OTP round trip — send an OTP to the phone number, then verify the code the customer entered — plus a separate call to verify information about the SIM/phone number directly.

Sim verification send OTP

This service allows you to send OTP to a phone number.

1. Request

MethodPathContent-TypeAuth Required
POST/v1/sim_verification_send_otpapplication/jsonYes

Request Body:

JSON
{
    "phone_number": string
}

Where

NameTypeRequiredDescription
phone_numberstringYesSend OTP to this number.

Authentication mechanism is described in Authentication.

Sample Request

bash
curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/sim_verification_send_otp \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
   "phone_number": "0909123456"
}
'

2. Response

The response will be a JSON with following format:

javascript
{
    "data": {
        "status": string, // "success" or "failure"
        "phone_number": string,
        "request_id": string // return request id to the client and can use request-id to check logs.
        "telco": string, // vnpt, viettel or mobifone
    },
    "errors": [
            {
                "code": string,
                "message": string,
                "detail": {
                    "field": string, // optional, which parameter is invalid.
                    ... // any other information that can be useful for client
                },
            },
            ... // other errors
        ]
}

In case the request processing has been finished, the HTTP status code will be

200, and the data.status is either "success" or "failure" depending on whether the request has been successfully processed or not.

If the data.status is "failure", the "errors" field will tell you why it

failed.

error codedescription
failed_to_send_otpFailed to send the one-time password (OTP).
invalid_otp_formatThe provided OTP has an invalid format.
unsupported_telcoThe telecommunications provider is not supported.

In case of any other errors, the data field will be empty, and the server sends one of the following HTTP status codes with an error code:

HTTP codeerror codedescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

Sample Response

JSON
{
    "data": {
        "status": "success",
        "phone_number": "0909123456",
        "request_id": "48ff3909-6402-4cde-a9d4-972b0f72969c",
        "telco": "vnpt"
    }
}

Sim verification verify OTP

This service allows you to verify OTP sent to phone.

1. Request

MethodPathContent-TypeAuth Required
POST/v1/sim_verification_verify_otpapplication/jsonYes

Request Body:

JSON
{
    "phone_number": string,
    "otp": string
}

Where

NameTypeRequiredDescription
phone_numberstringYesVerify OTP of this number.
otpstringYesOTP sent by telco to phone number.

Authentication mechanism is described in Authentication.

Sample Request

bash
curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/sim_verification_verify_otp \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
   "phone_number": "0909123456",
   "otp": "123456"
}
'

2. Response

The response will be a JSON with following format:

javascript
{
    "data": {
        "status": string, // "success" or "failure"
        "phone_number": string,
        "request_id": string // return request id to the client and can use request-id to check logs.
    },
    "errors": [
            {
                "code": string,
                "message": string,
                "detail": {
                    "field": string, // optional, which parameter is invalid.
                    ... // any other information that can be useful for client
                },
            },
            ... // other errors
        ]
}

In case the request processing has been finished, the HTTP status code will be

200, and the data.status is either "success" or "failure" depending on whether the request has been successfully processed or not.

If the data.status is "failure", the "errors" field will tell you why it

failed.

error codedescription
incorrect_otpThe provided OTP is incorrect.
otp_expiredThe one-time password (OTP) has expired.
otp_already_usedThe one-time password (OTP) has already been used.
failed_to_verify_otpFailed to verify the one-time password (OTP).

In case of any other errors, the data field will be empty, and the server sends one of the following HTTP status codes with an error code:

HTTP codeerror codedescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

Sample Response

JSON
{
    "data": {
        "status": "success",
        "phone_number": "0909123456",
        "request_id": "48ff3909-6402-4cde-a9d4-972b0f72969c",
    }
}

Sim verification verify information

This service allows you to verify information of sim owner.

1. Request

MethodPathContent-TypeAuth Required
POST/v1/sim_verification_verify_infoapplication/jsonYes

Request Body:

JSON
{
    "phone_number": string,
    "fields": [
      {
        "name": "field_name",
        "value": "value of this field"
      },
      ...
    ]
}

Where

NameTypeRequiredDescription
phone_numberstringYesVerify information of this number.
fieldsarrayYesList field name and value need to check.

Which each field's parameters contains:

NameTypeRequiredDescription
namestringYesname of field data need to verify.
valuestringYesvalue of field need to check same or not.

List supported fields

namevaluedescription
is_ideg. 079012123456id number of CCCD.
is_nameeg. Nguyễn Văn Aname of CCCD.
is_dobeg. 01/01/1980date of birth of sim owner, format dd/MM/yyyy
is_issue_dateeg. 01/01/2025issue date of CCCD, format dd/MM/yyyy
is_port_outno required valueis subscriber port out or not
is_port_inno required valueis subscriber port in or not
is_active_last_90no required valueis subscriber active in 90 days or not
is_subscriber_activeno required valueis subscriber active or not
has_usage_last_90no required valueis subscriber has usage last 90 days or not
has_changed_device_last_30no required valueis subscriber has change device last 30 days or not
is_use_cf_serviceno required valueis subscriber use cf service or not
has_changed_id_last_30no required valueis subscriber change ID Number in last 30 days or not
is_top_20_contact_last_30eg. 0909112233is phone_number in top 20 contact last 30 days

Authentication mechanism is described in Authentication.

Sample Request

bash
curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/sim_verification_verify_info \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
   "phone_number": "0909123456",
   "fields": [
      {
        "name": "is_id",
        "value": "079012123456",
      },
      {
        "name": "is_name",
        "value": "Nguyễn Văn A",
      }
   ]
}
'

2. Response

The response will be a JSON with following format:

javascript
{
    "data": {
        "status": string, // "success" or "failure"
        "phone_number": string,
        "request_id": string // return request id to the client and can use request-id to check logs.
        "fields": [
          {
            "name": string,  // field name to check
            "value": string, // value of field name to check
            "verdict": string, // "matched|unmatched|no_data" return verdict of value same with sim owner information in telco or not
          }
          ...
        ]
    },
    "errors": [
            {
                "code": string,
                "message": string,
                "detail": {
                    "field": string, // optional, which parameter is invalid.
                    ... // any other information that can be useful for client
                },
            },
            ... // other errors
        ]
}

In case the request processing has been finished, the HTTP status code will be

200, and the data.status is either "success" or "failure" depending on whether the request has been successfully processed or not.

If the data.status is "failure", the "errors" field will tell you why it

failed.

error codedescription
invalid_phone_numberThe provided phone number is invalid.
verification_session_expiredThe verification session has expired.
failed_to_verify_infoFailed to verify the information.

In case of any other errors, the data field will be empty, and the server sends one of the following HTTP status codes with an error code:

HTTP codeerror codedescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

Sample Response

JSON
{
    "data": {
        "status": "success",
        "phone_number": "0909123456",
        "request_id": "48ff3909-6402-4cde-a9d4-972b0f72969c",
         "fields": [
          {
            "name": "is_id",
            "value": "079012123456",
            "verdict": "matched"
          },
          {
            "name": "is_name",
            "value": "Nguyễn Văn A",
            "verdict": "unmatched"
          }
        ]
    }
}