Skip to main content
Version: 3.0.1

Apptenticate Biometrics

POST

  https://api.apptenticate.com/api/biometrics/foreigns/


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 Biometrics microservice that allows biometric verification of people without Panamanian ID cards, through their identity document (passports or ID cards from other countries) or with their profile photo. These requests must contain at least two parameters: the photo of the non-Panamanian document and a .jpg image of its face. In the end, the Apptenticate Biometrics microservice will respond if the face in the document matches the face in the person's selfie.

** NOTE **

• The response may be 401 unauthorized if the JWT token must be refreshed.

• The image 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.

• If you wish to improve the accuracy of the life test (if this service is contracted), the device type must be indicated in the JSON of the request. These can be "DESKTOP", "IOS" or "ANDROID" and the way to specify it would be "device":"IOS", for example.

• 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”, “identification_card” or “profile_image”.

Request structure - method: POST

Path: api/biometrics/foreigns/

Payload for base request:

Payload: {
'frontside': Image of the front of the document,
'selfie': Image of the person's selfie,
'document_type': 'passport', 'identification_card' or 'profile_image',
} // (where images are .jpg files)

If you want to obtain the transaction ID:

Payload: {
'frontside': Image of the front of the document,
'selfie': Image of the person's selfie,
'document_type': 'passport', 'identification_card' or 'profile_image',
'return_id':True
} // (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,
'selfie': Image of the person's selfie,
'document_type': 'passport', 'identification_card' or 'profile_image',
'device':'IOS', // Devices: IOS, ANDROID or DESKTOP
} // (where images are .jpg files)

Examples of requests

Python

#JWTToken
header = { 'Authorization': 'Bearer {}'.format(token) }

# Payload for base request
data = {'document_type': 'passport'}
files = {
'frontside': image_1.jpg,
'selfie': image_2.jpg,
} # Where images are .jpg files

# If you want to obtain the transaction ID:
data = {'document_type': 'passport', 'return_id': True}
files = {
'frontside': image_1.jpg,
'selfie': image_2.jpg,
} # Where images are .jpg files

# If you want to improve the accuracy of the life test
data = {'document_type': 'passport', 'device': 'IOS'}
files = {
'frontside': image_1.jpg,
'selfie': image_2.jpg,
} # Where images are .jpg files

# Send request
response = requests.post(
apptenticate_url,
data=data,
files=files,
headers=header
)
response = json.loads(response.content)

Response structure

Response format: JSON

Base response:

Answer: {
"valid": True or False, // Boolean which determines whether the request resulted in a successful validation or not
"error": "String with short description of the error",
"details": "A string specifying the error, or a key-value pair detailing whether any of the parameters are invalid and the error",
"error_code": error code (int)
}

In addition to the response, the status code corresponding to the outcome of the operation is sent.

Response with transaction ID:

Answer: {
"valid": True or False, // Boolean which determines whether the request resulted in a successful validation or not
"error": "String with short description of the error",
"details": "A string specifying the error, or a key-value pair detailing whether any of the parameters are invalid and the error",
"error_code": error code (int),
"id": transaction number (int),
}

Errors

CodeMessage
900"Frontside" could not be processed correctly.
901"Selfie" could not be processed correctly.
902The face could not be extracted from the "frontside".
903"The face could not be extracted from the selfie."
904The biometric validation engine has failed (accompanied by a status code of 500).
905Faces do not match.
909The "frontside" was not sent in the request.
910The "selfie" was not sent in the request.
911“document_type” was not sent in the request.
912“document_type” must be type “passport” or “identification_card”.