API Request & Response (ID Forgery)

This method helps you to detect forgery attempt from 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).
is_qualitybooleanoptionalfalseDetermines whether Image Quality (blur, dark, flashlight, and grayscale) will be computed and return as result
validate_qualitybooleanoptionalfalseDetermines whether Quality validation will be executed. The validation consists of checking blur, dark, flashlight, and grayscale. validate_quality can be TRUE only when is_quality is TRUE.

🎈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 https://docs.verihubs.com/docs/status-code-id-forgery
reference_idstringUsed as the identity of the forgery check result.
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 no
forgerybooleanDetects whether the KTP image is genuine or not

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
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
200FAIL_ON_2forgery detected
500INTERNAL_SERVER_ERRORinternal server error

Sample Responses

Response CodeResponseDescription
200{
"status_code": "FRG-1",
"message": "Forgery detected",
"error_code": "FAIL_ON_2",
"data": {
"reference_id": "d6dc256e-254b-41de-9ffa-cb63682b57be",
"forgery": true,
"image_quality": {
"blur": true,
"dark": false,
"grayscale": false,
"blur_score": 99.351166,
"dark_score": 23.05619,
"flashlight": false
}
}
}
Request data parameter is valid.
400{
"message": "Invalid Payload",
"data": {
"message": "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.