SIM Verification

Verify subscriber information

POST/v1/sim_verification_verify_info

Checks identity details and account-activity signals for a phone number against what the telco holds, and returns a verdict for each field checked.

Request

MethodPOST
Path/v1/sim_verification_verify_info
Content-Typeapplication/json
Auth requiredYes — HMAC signing
NameTypeRequiredDescription
phone_numberstringRequiredVerify information of this number.
fieldsarrayRequiredList field name and value need to check.
JSON
{
    "phone_number": string,
    "fields": [
      {
        "name": "field_name",
        "value": "value of this field"
      },
      ...
    ]
}

The fields parameter

Each entry in fields contains:

NameTypeRequiredDescription
namestringRequiredname of field data need to verify.
valuestringRequiredvalue of field need to check same or not.

The name parameter

name selects which piece of subscriber information the entry checks — one of the supported fields below.

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

Sample request

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",
      }
   ]
}
'

Response

Each entry in data.fields echoes the name and value you sent and adds its own verdictmatched, unmatched or no_data. When processing finishes the HTTP status code is 200 and data.status is either "success" or "failure" depending on whether the request was processed successfully, so a 200 says the check ran and the per-field verdicts say what it found. data.request_id is the id to quote when checking logs, and the errors array follows the shared error envelope.

JSON
{
    "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
        ]
}

Two fields checked, one matched and one unmatched:

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"
          }
        ]
    }
}

Failure codes

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 an HTTP status code with an error code. Those are the same on every call — see Common objects & errors.