The final stage requires a comparison between two images to check that the person performing the process KYC It will be the document's holder. The image of the obtained (* bestFrame) will be compared during the life check step with the face image extracted from the document (* content.data.personal.face) during the data extraction step.
Just as in previous steps, images should be in Base64 Before they are sent to service. Thus, it's vital to conduct an image check to secure their proper transmission and processing.
URL
POST https://api.sandbox.jaak.ai/api/v2/oto/verify
@POST("api/v2/oto/verify")
suspend fun otoVerifyApi(@Header("Authorization") auth: String,
@Body request: OtoVerifyRequest): Response<OtoVerifyResponse>
Request
{
"eventId": String,
"image1": String,
"image2": String
}
data class OtoVerifyV2Request(
@SerializedName("eventId") val eventId: String, //base64
@SerializedName("image1") val image1: String, //base64
@SerializedName("image2") val image2: String, //base64
)
| Field | Type | Description |
|---|---|---|
| event | string | (optional) is the possibility of sending a unique identifier to track this call |
| image1 | string | Image 1 at Base64 for Comparison |
| image2 | string | Image 2 at Base64 for Comparison |
Answer
{
"eventId": String,
"requestId": String,
"score": Double,
"distance": Double,
"process_time": Integer,
"metadata": {
"image1": {
"accessories": {
"glass": Boolean,
"sunGlass": Boolean,
"hat": Boolean,
"mask": Boolean
},
"image_quality": {
"isCorrectBrightness": Boolean,
"isCorrectBlur": Boolean,
"isCorrectHeight": Boolean,
"isCorrectWidth": Boolean,
"isCorrectResolution": Boolean,
"isCorrectVerticalRotation": Boolean,
"isCorrectHorizontalRotation": Boolean,
"isCorrectRotation": Boolean,
"isCorrectSizeFace": Boolean,
"isCorrectNumberFaces": Boolean
}
},
"image2": {
"accessories": {
"glass": Boolean,
"sunGlass": Boolean,
"hat": Boolean,
"mask": Boolean
},
"image_quality": {
"isCorrectBrightness": Boolean,
"isCorrectBlur": Boolean,
"isCorrectHeight": Boolean,
"isCorrectWidth": Boolean,
"isCorrectResolution": Boolean,
"isCorrectVerticalRotation": Boolean,
"isCorrectHorizontalRotation": Boolean,
"isCorrectRotation": Boolean,
"isCorrectSizeFace": Boolean,
"isCorrectNumberFaces": Boolean
}
}
},
"codes": null,
"state": {
"rejectedBadQuality": Boolean,
"rejectedAccessories": Boolean,
"isSamePerson": Boolean,
"message": String
}
}
data class OtoVerifyV2Response(
@SerializedName("eventId") val eventId: String,
@SerializedName("requestId") val requestId: String,
@SerializedName("score") val score: Double,
@SerializedName("distance") val distance: Double,
@SerializedName("process_time") val processTime: Long,
@SerializedName("metadata") val metadata: Metadata,
@SerializedName("codes") val codes: List<Int>?,
@SerializedName("state") val state: State
)
data class Metadata(
@SerializedName("image1") val image1: ImageMetadata,
@SerializedName("image2") val image2: ImageMetadata
)
data class ImageMetadata(
@SerializedName("accessories") val accessories: Accessories,
@SerializedName("image_quality") val imageQuality: String?
)
data class Accessories(
@SerializedName("glass") val glass: Boolean,
@SerializedName("sunGlass") val sunGlass: Boolean,
@SerializedName("hat") val hat: Boolean,
@SerializedName("mask") val mask: Boolean
)
data class State(
@SerializedName("rejectedBadQuality") val rejectedBadQuality: Boolean,
@SerializedName("rejectedAccessories") val rejectedAccessories: Boolean,
@SerializedName("isSamePerson") val isSamePerson: Boolean,
@SerializedName("message") val message: String
)
| Field | Type | Description |
|---|---|---|
| event | string | ID for traceability of event details. |
| request | string | ID for demand traceability. |
| score | double | Result of the liveness detection. |
| distance | double | The result of a standardized liveness detection assessment. |
| process\ _ time | integrate | Test processing time for milliseconds. |
| methatate | object | Additional information about the analysis of the liveness detection, such as the search for accessories and image quality within comparative images |
| codes | object | Reg code list regarding image quality and accessories found within comparative images |
| status | object | Results of different verifications about the liveness detection. |
Object * state *
| Field | Type | Description |
|---|---|---|
| RejectedBadQuality | boolean | Flag that determines if images do not meet minimum quality standards |
| challenges | boolean | Flag determining if comparative images detect accessories |
| isSamePeru | boolean | Flag that determines if both people in images are the same |
| message | string | A message that provides additional information in case of discrepancy in comparison. |
The property * state.isSamePerson * allows us to ensure that the person who's being identified at the life check is the same as that of the document provided.
To sum up, if the property * state.isSamePerson * is accepted, then we can consider that the document's status check has been successful.
It's important that you finish sessions KYCWe'll explain how to do this at the next step.