Skip to main content
Version: 3.0.1

ID Reader Plus

POST

  https://api.apptenticate.com/api/v3/ocr/


Authentication

Use your JWT obtained from the authentication process to make requests to this endpoint.

The response will be 401 unauthorized if the JWT is expired. In this case you will have to obtain a new JWT.


This endpoint receives all requests directed to the Apptenticate OCR microservice that allows data to be extracted from identification documents.

If this service has been contracted, a Proof of Life verification of the document is carried out to verify the validity of the document. This service verifies the veracity of the image to detect attacks such as documents not physically possessed or manipulation of an otherwise authentic document, documents presented as a hard copy, face replacement, or documents on another screen.

In the end, the ID Reader microservice will return a JSON with the extracted data if the operation was successful, or the appropriate error if it fails the proof-of-life check.

NOTE

  • The response may be 401 unauthorized if the JWT token must be refreshed.
  • Images sent in jpg format must not exceed 2MB.
  • If you want to obtain the transaction ID in the response, you must indicate "return_id": "True" in the JSON of the request.
  • It must be specified in the request whether a photo of a passport or ID is sent using the “document_type” parameter, which can take the values “passport” or “identification_card”.

Request structure - method: POST

The payload sent is the same for IDs and Passports

Ruta: api/ocr/

Payload for base request:

Payload: {
'frontside': Image of the front of the document,
'document_type': 'passport'
'document_id': Passport code // optional if you want to obtain the OCR of a passport that is supported in the library
} // (where images are .jpg files)

If you want to obtain the transaction ID:

Payload: {
'frontside': Image of the front of the document,
'document_type': 'passport',
'return_id':True
'document_id': Passport code // optional if you want to obtain the OCR of a passport that is supported in the library
} // (where images are .jpg files)

If you want to improve the precision of the life test

Payload: {
'frontside': Image of the front of the document,
'document_type': 'passport',
'device':'IOS', // Devices: IOS, ANDROID or DESKTOP
'document_id': Passport code // optional if you want to obtain the OCR of a passport that is supported in the library
} // (where images are .jpg files)

Request examples

Answers to documents that do not pass the life test

Ruta: api/ocr/
{
"valid": false,
"error_code": 820,
"error": "The document photo is not detected in the image.",
"id": 391
},

{
"valid": false,
"error_code": 821,
"error": "The document is cropped, part of the document is not present in the image.",
"id": 392
},

{
"valid": false,
"error_code": 819,
"error": "The document is not detected in the image.",
"id": 393
}

Códigos de error:

CodigoMensaje
819The document is not detected in the image.
820The document photo is not detected in the image.
821The document is cropped, part of the document is not present in the image.