Extract - KTP Sync
This method helps you to extract text in KTP image.
🎈Endpoint
Method | Endpoint |
---|---|
POST | https://api.verihubs.com/v2/ktp/extract |
🎈Request
Headers
Key | Type | Notes | Description |
---|---|---|---|
App-ID | String | Required | Application ID that generated from Application Menu in Verihubs Client Dashboard. To hit in Testing and Live mode you need a Production Application ID. |
API-Key | String | Required | API-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
Parameter | Type | Notes | Default | Description |
---|---|---|---|---|
image | String | Required | - | - A base64 or URL image file. - Image Type JPEG, JPG, PNG - Max File size: 5MB - Minimum KTP image size 720x480 (cropped KTP). |
validate_quality | boolean | optional | false | - Determines whether Quality validation will be executed. The validation consists of checking blur, dark, grayscale, and flashlight. |
🎈Responses
Response Code
Code | Description |
---|---|
200 | Successful Response |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Details for 200
Key | Type | Description |
---|---|---|
message | string | Message that describe the overall response. |
status_code | string | Status that indicate the billing calculation. See status code list in this link. |
image_quality | object | Describes image quality detail |
blur | boolean | Describes whether input image is considered as blur (If it exceeds the threshold, it will detected as blur) |
dark | boolean | Describes whether input image is considered as dark (If it exceeds the threshold, it will detected as dark) |
flashlight | boolean | Detects whether flashlight is detected or not |
grayscale | boolean | Detects whether KTP is black & white or not |
address | string | Shows address extracted from KTP |
administrative_village | string | Shows administrative village extracted from KTP |
blood_type | string | Shows blood type extracted from KTP |
city | string | Shows city extracted from KTP |
date_of_birth | string | Shows dob extracted from KTP |
district | string | Shows district extracted from KTP |
full_name | string | Shows full name extracted from KTP |
gender | string | Shows gender extracted from KTP |
marital_status | string | Shows marital status extracted from KTP |
nationality | string | Shows nationality extracted from KTP |
nik | string | Shows nik extracted from KTP |
occupation | string | Shows occupation extracted from KTP |
place_of_birth | string | Shows place of birth extracted from KTP |
religion | string | Shows religion extracted from KTP |
rt_rw | string | Shows RT and RW extracted from KTP |
state | string | Shows state extracted from KTP |
Error Code
Response Code | Error Message | Description |
---|---|---|
400 | INVALID_PAYLOAD | no value in payload or empty string more than 1 |
400 | INVALID_PAYLOAD_IMAGE_MISSING | invalid payload image not a standard b64/url or image empty string |
400 | INVALID_PAYLOAD_IMAGE_SIZE | invalid payload image size too large |
400 | INVALID_PAYLOAD_IMAGE_FORMAT | image unable to be decoded/got from url OR invalid image extension |
400 | MISSING_PAYLOAD_IMAGE | missing payload image |
400 | KTP_NOT_DETECTED | KTP not detected from image |
400 | INVALID_PAYLOAD_QUALITY_VALIDATION_DEPENDENCY | is_quality must be true if validate_quality true |
403 | INSUFFICIENT_QUOTA | quota for extract/quality is not sufficient to further continue the request (Only appears on testing mode) |
200 | FAIL_ON_1 | fail on quality |
500 | INTERNAL_SERVER_ERROR | internal server error |
Sample Responses
Response Code | Response | Description |
---|---|---|
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. |
Updated 3 days ago