Legacy Restful API
1.0.0
1.0.0
  • Introduction
  • Biometric Engines
  • Getting Started
  • User
    • Create User
    • Delete User
  • Face Engine
    • Enroll Face
    • Verify Face
    • Adapt Face
    • Delete User Face Enroll
    • Find User Id by Face
    • Find Multiple Id by Face
    • Find Face Properties
  • Liveness
    • Biometrics Status
    • Biometrics Liveness
  • Voice Engine
    • Enroll Voice
    • Verify Voice
    • Adapt Voice
    • Delete User Voice Enroll
    • Get Available Languages
  • OCR Engine
    • Validate Document
    • Validate Document (base64)
    • Verify document photo
    • Verify document photo (base64)
  • Auxiliar Methods
    • Get enroll Status
    • Has Pending Dialogue
    • Restart User State
    • Find UserId by MacAddress
Powered by GitBook
On this page
  • Validate Document (base64)
  • Success 200

Was this helpful?

  1. OCR Engine

Validate Document (base64)

This endpoint allows the OCR validation process on the document sent on the request. ( Expecting images to be string base64)

To perform a document validation, the method to be used is Validate Document. The request to this method requires the sending of two photos (front & back of the document represented in string base64).

This process will perform:

  • Automatic ID type recognition

  • Algorithmic-based checks

  • Detect security features in global identity documents

  • Reading and extraction of all documents fields

In case of a validation success BiometrID will retrieve all the data extracted from the document.

Validate Document (base64)

POST Https://api.biometrid.com/api/1.0/document/validate-base64

Validate document process

Headers

Name
Type
Description

Content-type

string

Request content type (This is not required to be set. Referenced only to show how we expect data to be sent). { "Content-Type": "application/json" }

x-biometrid-key

string

Application Client Key

x-biometrid-secret

string

Application Client Secret

Request Body

Name
Type
Description

doctype

string

Required if document type different than idcard. Possible values: idcard, passport. If not present, by default, the system will expect idcard evaluation

front

string

Image (base64 string) representation of the document's front side for biometric analysis.

back

string

Image (base64 string) representation of the document's back side for biometric analysis.

processId

string

Optional process id. Setup a specific process id.

HTTP/1.1 200 OK
//Validate Document Process
{
    "status": true,
    "data": {
        "message": "DOCUMENT_VALIDATED_WITH_SUCCESS",
        "result": "Ok",
        "side": "0",
        "reference": "123",
        "frontCut": String base64,
        "backCut": String base64,
        "photo": String base64,
        "signature": String base64,
        "fields": {
          "normal": { ... },
          "validation": { ... }
        }
    }
}
//Validate Document Process Failed
{
    "status": true,
    "data": {
        "message": "DOCUMENT_VALIDATION_FAILED",
        "result": "Warning",
        "side": "0",
        "reference": "123",
        "frontCut": String base64,
        "backCut": String base64,
        "photo": String base64,
        "signature": String base64,
        "fields": {
          "normal": { ... },
          "validation": { ... }
        }
    }
}
//Document Not Recognised
{
    "status": false,
    "data": {
        "message": "FAILED_TO_RECOGNIZE_DOCUMENT"
    }
}
HTTP/1.1 400 Bad Request
//No photo files detected on request. Not sent or invalid format
    {
        "status": false,
        "data": {
            "message": "NO_FILE_OR_INVALID_FORMAT"
        }
    }
//Missing photo files on request
{
    "status": false,
    "data": {
        "message": "EXPECTING_ALL_DOCUMENT_SIDES_TO_BE_PRESENT"
    }
}
// Missing Headers
 {
    "status": false,
    "data": {
        "message": "AUTHENTICATION_HEADERS_MISSING"
    }
}

// Unexpected Fields
 {
    "status": false,
    "data": {
        "message": "UNEXPECTED_FIELD"
    }
}

// Invalid front String base64 (min-validation)
 {
    "status": false,
    "data": {
        "message": "INVALID_BASE64STRING_FRONT"
    }
}

// Invalid back String base64 (min-validation)
 {
    "status": false,
    "data": {
        "message": "INVALID_BASE64STRING_BACK"
    }
}
HTTP/1.1 401 Unauthorized
{
    "status": false,
    "data": {
        "message": "INVALID_AUTHENTICATION_HEADERS"
    }
}
HTTP/1.1 402 Payment Required
{
    "status": false,
    "data": {
        "message": "REQUEST_LIMIT_REACHED"
    }
}
HTTP/1.1 404 Not Found
//Client not found by given key.
{
    "status": false,
    "data": {
        "message": "CLIENT_NOT_FOUND/CHECK_AUTHENTICATION_HEADERS"
    }
}
HTTP/1.1 405 Method Not Allowed
{
    "status": false,
    "data": {
        "message": "NO_DOCUMENT_ENGINE_CONFIGURATION_AVAILABLE"
    }
}
HTTP/1.1 504 Gateway Timeout
{
    "status": false,
    "data": {
        "message": "REQUEST_TIMEOUT_EXCEEDED"
    }
}
Example (JSON)
{
    "front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA...",
    "back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA...",
    "processId": "123"
}

Success 200

Field

Type

Description

status

Boolean

Response status.

data

Object

Response main data.

message

String

Message regarding the document's process.

result

String

Result of the document's process.

side

String

Code for the document side that were processed. 0: both sides were processed 1: front side was processed, 2: back side was processed.

reference

String

Process identifying code.

frontCut

String

Front image cut result. Image in Base64 string.

backCut

String

Back image cut. Image in Base64 string.

photo

String

Photo image cut. Image in Base64 string.

signature

String

Signature image cut. Image in Base64 string.

fields

String

Document's processed fields.

normal

String

Processed fields values.

validation

String

Processed fields validation.

PreviousValidate DocumentNextVerify document photo

Last updated 5 years ago

Was this helpful?