Extract - KTP Async
Asynchronous KTP method helps you to recognize text in the KTP image and the response is returned immediately while the request continues to be processed. There is an option to provide a callback URL, so once the process is complete the result will be returned to the given URL. Otherwise, you can call the get result method to pull the result.
If you use a callback URL, we also provide extra authentication using HTTP basic authentication. This allows you to check whether the request sent to your URL is sent by our backend by looking at the Authorization HTTP header. The username and password can be set to an application ID in Verihubs Client dashboard (app.verihubs.com). Please refer to the documentation in this link.
🎈Endpoint
Method | Endpoint |
---|---|
POST | https://api.verihubs.com/ktp/id/extract-async |
🎈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, and flashlight |
reference_id | string | optional | - | Used as the identity of the recognition result. |
callback_url | string | optional | - | Used to send recognition results to a specific url. |
🎈Responses
Response Code
Code | Description |
---|---|
200 | Successful Response |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Details for 200 and 201
Key | Type | Description |
---|---|---|
message | string | Message that describe the overall response. |
data | object | Shows the id used to pull the recognition result |
reference_id | string | used as the identity of the recognition result |
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 | INVALID_PAYLOAD_CALLBACK_URL | callback url payload is empty/null/ not url format (https://) |
400 | INVALID_PAYLOAD_REFERENCE_ID | reference_id is too short/too long |
400 | INVALID_PAYLOAD_REFERENCE_ID_EXISTS | reference_id already exists (not unique) |
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": "accepted", "data": { "reference_id": "04ceb099-2b5c-4003-b483-9834a797d5e0" } } | Request data parameter is valid. |
422 | { "message": "Invalid Payload", "error_code": "BAD_PAYLOAD" } | Invalid Payload. Transaction that is considered failed due to validation errors. |
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 7 days ago