NFC · Standard API · eKYC Core
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
| Name | Type | Required | Description |
|---|---|---|---|
id_num | string | Required | ID Number in raw format or SHA256 hash |
issue_date | string | Optional | Issue date in format DD/MM/YYYY |
{
"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.
{
"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:
{
"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 code | Error code | Description |
|---|---|---|
401 | access_denied_exception | You are not authorized to perform the action. |
400 | invalid_parameter_exception | Input parameter violates a constraint. |
400 | request_time_too_skewed | The X-TV-Timestamp header is expired, need a newer one. |
404 | request_not_found_exception | The request ID is not found when polling result by id |
408 | request_timeout_exception | Request takes too long to process |
429 | rate_limit_exception | The number of requests exceeded your throughput limit. |
500 | internal_server_error | Some 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.