v1

latestOpenAPI 3.0.22026-07-2432112226.7 KB
KTP - Synchronous

Extract KTP (Synchronous)

Synchronous KTP method helps you to recognize text in KTP image and the extraction result will be processed and returned immediately.

The detection of KTP quality is always checked in this Extract KTP Synchronous, but you can set whether you want to validate your KTP quality photo by using validate_quality request.

You will receive a response consists of message and an error code if the request fails to process. The following is a list of error codes. <br>

Error statusError codeDescription
400INVALID_PAYLOADNo value in payload or empty string more than 1
400INVALID_PAYLOAD_IMAGE_MISSINGImage empty string
400INVALID_PAYLOAD_IMAGE_SIZEImage size too big/too small
400INVALID_PAYLOAD_IMAGE_FORMATImage unable to be decoded/got from url OR invalid image extension
400MISSING_PAYLOAD_IMAGEMissing payload image
400KTP_NOT_DETECTEDKTP not detected from image
400INVALID_PAYLOAD_REFERENCE_IDreference_id is too short/too long
400INVALID_PAYLOAD_REFERENCE_ID_EXISTSreference_id already exists (not unique)
400INVALID_PAYLOAD_QUALITY_VALIDATION_DEPENDENCYis_quality must be true if validate_quality true
403INSUFFICIENT_QUOTAQuota for extract/quality is not sufficient to further continue the request (Only appears on testing mode)
500INTERNAL_SERVER_ERRORInternal server error
post/v2/ktp/extract

Headers

App-IDstring required
API-Keystring required

Request body

imagestring required

A base64 image file

validate_qualityboolean

A flag to determine whether quality validation will be executed. The validation consists of checking blur and dark with threshold.

Response

Successful Response

Messagestring

Message indicating the status of the request to be processed

error_codestring

This error_code indicates an error that appeared in processing the request from the extract-async method

Example response

{
  "Message": "Success Extract KTP data",
  "error_code": "FAIL_ON_1"
}