NFC · Standard API · eKYC Core

Check NFC

POST/v1/check_nfc

Checks whether an ID card has already had its NFC chip verified by TrustVision, and returns the SOD hash and the list of fields that were submitted.

Request

MethodPOST
Path/v1/check_nfc
Content-Typeapplication/json
Auth requiredYes — HMAC signing
NameTypeRequiredDescription
id_numstringRequiredID Number in raw format or SHA256 hash
issue_datestringOptionalIssue date in format DD/MM/YYYY
JSON
{
    "id_num": string,
    "issue_date": string
}

Sample request

curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/check_nfc \
-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 \
'
{
    "id_num": "0123456789",
    "issue_date": "01/01/2001"
}
'

Response

data.nfc_check.status carries the answer — verified if TrustVision has verified this card's NFC chip before, not_verified if it has not. data.status is "success" or "failure" only according to whether the request was processed, and errors uses the shared response envelope.

JSON
{
  "data": {
      "status": string, // "success" or "failure"
      "nfc_check": {
        "status": string, // "verified" or "not_verified"
        "hash_sod": string, // hash of SOD data (SHA512) if found
        "input_fields": string[], // list of input fields if status = "verified" (e.g. ["dg1", "dg13", "dg2", "dg14", "dg15", "com", "cccd"])
      },
  },
  "errors": [
      {
          "code": string,
          "message": string,
          "detail": {
              "field": string, // optional, which parameter is invalid.
              ... // any other information that can be useful for client
          },
      },
      ... // other errors
  ]
}

A card that has been verified before comes back like this:

JSON
{
  "data": {
      "status": "success",
      "nfc_check": {
        "status": "verified",
        "hash_sod": "ebc713d2781df95e69fe83eacb1be93...",
        "input_fields": ["dg1", "dg13", "dg2", "dg14", "dg15", "com", "cccd"]
      }
  }
}

Failure codes

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

In case of any other errors, the data field will be empty, and the server sends one of following HTTP status code with 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.
404request_not_found_exceptionThe request ID is not found when polling result by id
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

The codes above are the ones documented for this endpoint. Response errors on the Overview lists the codes for the eKYC Core surface as a whole — the two lists do not match on every endpoint.