Extract - KTP Sync

This method helps you to extract text in KTP image.

🎈Endpoint

🎈Request

Headers

KeyTypeNotesDescription
App-IDStringRequiredApplication ID that generated from Application Menu in Verihubs Client Dashboard.
To hit in Testing and Live mode you need a Production Application ID.
API-KeyStringRequiredAPI-Key that generated from Application Menu in Verihubs Client Dashboard that related to specific Application ID.

You can generate your Application ID and API-Key in the Application page in Verihubs Client Dashboard..

Body Parameters

ParameterTypeNotesDefaultDescription
imageStringRequired-- A base64 or URL image file. - Image Type JPEG, JPG, PNG - Max File size: 5MB - Minimum KTP image size 720x480 (cropped KTP).
validate_qualitybooleanoptionalfalse- Determines whether Quality validation will be executed. The validation consists of checking blur, dark, grayscale, and flashlight.

🎈Responses

Response Code

CodeDescription
200Successful Response
400Bad Request
401Unauthorized
500Internal Server Error

Details for 200

KeyTypeDescription
messagestringMessage that describe the overall response.
status_codestringStatus that indicate the billing calculation. See status code list in this link.
image_qualityobjectDescribes image quality detail
blurbooleanDescribes whether input image is considered as blur (If it exceeds the threshold, it will detected as blur)
darkbooleanDescribes whether input image is considered as dark (If it exceeds the threshold, it will detected as dark)
flashlightbooleanDetects whether flashlight is detected or not
grayscalebooleanDetects whether KTP is black & white or not
addressstringShows address extracted from KTP
administrative_villagestringShows administrative village extracted from KTP
blood_typestringShows blood type extracted from KTP
citystringShows city extracted from KTP
date_of_birthstringShows dob extracted from KTP
districtstringShows district extracted from KTP
full_namestringShows full name extracted from KTP
genderstringShows gender extracted from KTP
marital_statusstringShows marital status extracted from KTP
nationalitystringShows nationality extracted from KTP
nikstringShows nik extracted from KTP
occupationstringShows occupation extracted from KTP
place_of_birthstringShows place of birth extracted from KTP
religionstringShows religion extracted from KTP
rt_rwstringShows RT and RW extracted from KTP
statestringShows state extracted from KTP

Error Code

Response CodeError MessageDescription
400INVALID_PAYLOADno value in payload or empty string more than 1
400INVALID_PAYLOAD_IMAGE_MISSINGinvalid payload image not a standard b64/url or image empty string
400INVALID_PAYLOAD_IMAGE_SIZEinvalid payload image size too large
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_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)
200FAIL_ON_1fail on quality
500INTERNAL_SERVER_ERRORinternal server error

Sample Responses

Response CodeResponseDescription
200{
"message": "Successfully extracted KTP data",
"data": {
"reference_id": "df9863cb-24d6-41cb-af03-14343b735c85",
"nik": "3302061509950001",
"city": "KABUPATEN BANYUMAS",
"rt_rw": "002/004",
"state": "PROVINSI JAWA TENGAH",
"gender": "MALE",
"address": "JL. SIBRAMA NO.40",
"district": "KEMRANJEN",
"religion": "ISLAM",
"full_name": "TEGUH KURNIADI",
"blood_type": "-",
"occupation": "OTHERS",
"nationality": "INDONESIA",
"date_of_birth": "25-03-1977",
"marital_status": "MARRIED",
"place_of_birth": "FUJIAN",
"administrative_village": "SIBRAMA",
"image_quality": {
"blur": false,
"dark": false,
"grayscale": false,
"blur_score": 42.48580418057,
"dark_score": 20.60020008003,
"flashlight": false
}
},
"status_code": "KTP-5"
}
Request data parameter is valid.
400{
"message": "Invalid Payload",
"data": {
"message": "BAD_PAYLOAD"
}
}
Invalid Payload. Transaction that is considered failed due to validation errors.
400{
"message": "KTP not detected",
"error_code": "KTP_NOT_DETECTED"
}
Request image is invalid (not a KTP image).
401{
"message": "Authorization failed"
}
Authorization Failed; Transaction that unauthorized due to Application ID or API-Key issue. To hit in Testing and Live mode you need a Production Application ID and API-Key.
403{
"message": "Insufficient quota",
"error_code": "INSUFFICIENT_QUOTA"
}
The transaction is in Testing mode and not enough remaining quota. Please contact Verihubs Customer Support.
500{
"message": "Internal server error"
}
Internal server error.