API Reference
中文

Liveness API

Retrive license API

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

ParameterTypeDescriptionRequired/OptionalNotes
session_durationIntegerDuration of the license's effective timeframeOptionalThe default duration is 600 seconds, with a maximum of 86,400 seconds. The unit is seconds.

Response Parameters

ParameterTypeDescriptionNotes
codeIntegerAPI status codePlease refer to below API Code list
messageStringStatus InformationDetailed reasons will be provided about API status
sequence_idStringUnique response codeA unique ID used to track each request
licenseStringLiveness detection initialization licenseThe license is used to initiate the liveness detection process in SDK subsequently.
expiry_timestampIntegerLicense expiration timestampThe timestamp when the license expires, e.g., 1715667188.

Response Example

  • Request
{
    "session_duration": 600  //optional
}
  • Success
{
    "code": 200,
    "message": "success",
    "sequence_id": "17119500882*****29",
    "license": "a41701e49******3",
    "expiry_timestamp": 1715667188
}
  • Failed
{
    "code": 11350,
    "sequence_id": "69b57131b6fb********61ccba118b60",
    "message": "Internal error"
}

Retrive result API

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

ParameterTypeDescriptionRequired/OptionalNotes
liveness_idStringLiveness detection IDRequiredLiveness detection ID generated in the above SDK output of Step 2, representing unique liveness detection process

Response Parameters

ParameterTypeDescriptionNotes
codeIntegerAPI status codePlease refer to below API Code list
messageStringStatus InformationDetailed reasons will be provided about API status
sequence_idStringUnique response codeA unique ID used to track each request,iOS get the livenessId in the TDLivenessResultStruct structure as the value of liveness_id
imageStringLiveness detection face picturesThe best face picture captured during the liveness detection process, in base64 format
scoreDoubleLiveness detection confidence scoreReserved field. Currently, only the code=200 indicates that the liveness test has been passed.(This field is not available in the SDK lite version.)

Response Example

  • Request
{
  "liveness_id": 1234567
}
  • Success
{
  "code": "200",
  "message": "success",
  "sequence_id": "1679299854228726325924",
  "image": "\/9j\/4AAQSkZJRgABAQAAAQABAAD\/2wBDAAMCA",
  "score": 0.98958
}
  • Failed
{
    "code": 11350,
    "sequence_id": "69b57131b6fb********61ccba118b60",
    "message": "Internal error"
}

API Code

CodeMessageCharged
200success (live person)YES
12202Identified as a blink attackYES
12203Identified as a mouth movement attackYES
12204Identified as a partial face attackYES
12205Identified as a video replay attackYES
12206Identified as a black and white imageYES
12207Identified as a paper-based attackYES
12208Identified as a frame (including paper or phone frame)YES
12209Identified as a moire pattern attackYES
12210Identified as a face superiority attackYES
12211Identified as a paper-based attack (optical flow)YES
12212Identified as a mask attackYES
12213Identified as an ID card attackYES
12214Identified as a 3D mask attackYES
12215Identified as a synthetic image attackYES
12216Identified as a black-market software attackYES
12217Identified as a T-type mask attackYES
12218Identified as a blurry imageYES
12219Suspected deepfake image attackYES
12220Suspected high-resolution screen attackYES
12221Light verification failedYES
12222Injection attackYES
12250Verification errorYES
11350Internal errorNO