The Callback Response Example section showcases sample responses that users can anticipate from API interactions, providing clarity on response structure and format. By utilizing these examples, users can effectively develop and test their integrations, ensuring smooth communication between their application and the API. This section serves as a valuable resource for enhancing the integration process and streamlining development efforts.

Response Examples

{
  "statusCode": 200,
  "apiType": "id_live_doc",
  "transactionId": "{{transactionId}}",
  "result": {
    "screenReplay": {
      "liveness_score": 99
    },
    "paperPrinted": {
      "liveness_score": 82
    },
    "replacePortraits": {
      "liveness_score": 100
    }
  }
}

Response Field Descriptions

Success Response Fields

FieldTypeDescription
statusCodenumberStatus Code for the API request result
apiTypestringAPI type identifier
transactionIdstringUnique identifier for each request
resultobjectObject containing the processing result
result.screenReplayobjectObject containing the result of the Screen Replay pipeline
result.screenReplay.liveness_scorenumberLiveness Score result of the Screen Replay check
result.paperPrintedobjectObject containing the result of the Paper Printed pipeline
result.paperPrinted.liveness_scorenumberLiveness Score result of the Paper Printed check
result.replacePortraitsobjectObject containing the result of the Replace Portraits pipeline
result.replacePortraits.liveness_scorenumberLiveness Score result of the Replace Portraits check

Error Response Fields

FieldTypeDescription
statusCodenumberStatus Code for the API request result
apiTypestringAPI Type identifier
transactionIdstringUnique identifier for each request
errorCodenumberIdentifies the specific error for troubleshooting
messagestringBriefly describes the error

Error Codes

Error CodeDescription
1003Fail to process data
1009Fail to analyze document

Understanding Liveness Scores

Score Ranges

  • 0-30: High risk of forgery
  • 31-60: Medium risk of forgery
  • 61-80: Low risk of forgery
  • 81-100: Very low risk of forgery

Pipeline Explanations

Screen Replay Detection

Detects if the submitted image is a screen capture or digital reproduction rather than a physical document.

Paper Printed Detection

Identifies if the document is a printed or photocopied version rather than an original.

Replace Portraits Detection

Checks if the face image on the document has been digitally altered or replaced.

Integration Guidelines

Handling Responses

  1. Check Status Code: Always verify the response status code first
  2. Parse Transaction ID: Store the transaction ID for reference
  3. Evaluate Scores: Review liveness scores for each pipeline
  4. Error Handling: Implement proper error handling for failed requests

Best Practices

  • Logging: Log all responses for debugging purposes
  • Retry Logic: Implement retry logic for transient failures
  • Validation: Validate response structure before processing
  • Security: Ensure secure handling of sensitive document data