Skip to main content
Version: 3.1.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)

Payload for ID base request:

Payload: {
'frontside': Image of the front of the document,
'backside': Image of the back of the document,
'document_type': 'identification_card',
} // (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
818Image quality for document liveness not acceptable.
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.
822The size of the document is lower than 10 % of the size of the image.
823The document borders are outside of the photo frame.
824There is more than one document in the photo frame.
825The document is near of the edges of the photo frame.
826The document is too blurry.
827The document is overly compressed..
828The document is either too bright or too dark.
829The document has reflections