API Reference
中文

Liveness Detection API

The liveness detection API is used to identify whether the detected object is a real person.

API Method

Base URL

API

URLRequest MethodsContent-TypeOutput FormatCharacter Set
api-base-url?partner_code=xxx&partner_key=xxxPOSTapplication/jsonJSONUTF-8
Authentication
ParameterTypeDescriptionRequired/OptionalNotes
partner_codeStringPartner CodeRequiredAssigned by TD
partner_keyStringPartner KeyRequiredAssigned by TD

Request

Parameter

Type

Description

Required/Optional

Notes

image

String

Portrait image

Required

Portrait photo, base64 photo of JPG, JPEG, PNG format, the image size limits to 3M

country

String

Country

Required

2-letter capitalized country code according to ISO 3166.
Please input "ID" when requesting the Indonesian URL.
Please input valid ISO country code when requesting the Global URL.

Response Parameter

Parameter

Type

Description

Notes

code

Integer

API status code

message

String

Status message

Return detailed API status information

sequence_id

String

Unique ID of response

A unique ID used to track each request

result

String

Verification result

Enumeration:
1. pass, when score >=0.7
2. fail, when score <0.7

score

Double

Liveness detection confidence score

Returned when result is success
Liveness detection confidence score [0.0-1.0], the greater of the value the greater probability of a live person.
Currently, the recommended threshold is 0.7.

API Status Code

CodeMessageCharged
200SuccessYES
12223Face has not been detectedYES
11301{parameter} emptyNO
11304The country partner located is not openNO
11340{parameter} errorNO
11350Internal errorNO
301Service not purchasedNO
302Service has been suspendNO
303Not enough balanceNO
304Service expiredNO
305Daily maximum volume reachedNO

Response Example

  • Success
{
    "code": 200,
    "message": "success",
    "sequence_id": "557a00180577433ba002201cd1b0f306",
    "result": "pass",
    "score": 0.995061
}
  • Failed
{
   "code": 11304,
   "message": "The country partner located is not open",
   "sequence_id": "d2b38289a10f48d487ee7317260078c0"
}