Saltar al contenido principal

/authenticateFacial

Description

This service performs facial validation between two faces, including both open images and biometric templates. The service can be used for the following validations:

  1. Facial authentication between two open images:
    • Generated or not by FacePhi widgets.
  2. Facial authentication between two biometric templates:
    • Requires integration of FacePhi Selphi Mobile or Web widget.
  3. Facial authentication between an open image and a biometric template:
    • Requires integration of FacePhi Selphi Mobile or Web widget.
  4. Facial authentication between the face present in the identity document photo (TokenFaceImage) and an open image:
    • Requires integration of FacePhi SelphID Mobile widget.
  5. Facial authentication between the face present in the identity document photo (TokenFaceImage) and a biometric template:
    • Requires integration of FacePhi Selphi Mobile and SelphID Mobile widgets.

Request:

curl --location '{IDENTITY_API_BASE_URL}/services/authenticateFacial' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"token1": "BASE64_IMAGE_OR_TOKEN",
"token2": "BASE64_IMAGE_OR_TOKEN",
"method": 1,
"tracking": {
"extraData": "BQABAQG2gBNjuHN...",
"operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
}
}'

Request parameters:

ParameterType (Content)RequiredDescription
token1String (Base64)YesImage used as reference for facial comparison. Depending on the method invoked, it can be the token generated by the SelphID widgets (document photo token), an open image, or a tokenized biometric template.
token2String (Base64)YesImage used for the comparison. It can be an open image or a tokenized biometric template.
methodIntegerYesIndicates the comparison method invoked according to the following specification (methods 1 to 5):
trackingJSON ObjectNoObject that represents necessary tracking information.
extraDataString (Base64)NoToken generated by Mobile/Web SDK. Contains tokenized tracking information with Platform.
operationIdString (Base64)NoOperation identifier generated by Mobile/Web SDK.

Method Specification

MethodDescription
Method = 1Facial authentication using open images (token1: Base64, token2: Base64)
Method = 2Facial authentication using biometric templates (token1: templateRaw, token2: templateRaw)
Method = 3Facial authentication using an open image and a biometric template (token1: Base64, token2: templateRaw)
Method = 4Facial authentication using the token generated by the crop of the document photo and an open image (token1: tokenFaceImage, token2: Base64)
Method = 5Facial authentication using the token generated by the crop of the document photo and a biometric template (token1: tokenFaceImage, token2: templateRaw)

Example Response

{
"serviceResultCode": 0,
"serviceResultLog": "Positive",
"serviceTime": "516",
"serviceTransactionId": "a29cbe15-2b68-495f-b7eb-be985b21c486",
"serviceFacialAuthenticationHash": "47D0ACDCF08C348469C2F512BB59216B46DCD9B253822ED0E4EEAFCEB76AADD5AEF20CA31EC52D03EB290EBC91A6AD65FB0416F9EB2164D3854932153074289E",
"serviceFacialAuthenticationResult": 3,
"serviceFacialSimilarityResult": 0.99153554
}

Response fields:

IdentifierTypeDescription
serviceResultCodeIntegerCode indicating the overall result of the service execution. See Table 1 - Service Result Code
serviceTimeStringTotal processing time (milliseconds).
serviceFacialAuthenticationResultIntegerCode indicating the result of the facial matching. See Table 2 - Service Facial Authentication Result
serviceResultLogStringDescriptive field of the service execution result. Includes details when there is an error or exception in the module.
serviceFacialSimilarityResultFloatValue indicating the facial similarity between the face in the identity document photo and the selfie taken by the user. 1.0 = 100%
serviceTransactionIdStringTransaction identifier associated with the request processed by the API.
serviceFacialAuthenticationHashStringIntegrity hash of the biometric template used in a positive or uncertain facial authentication. Only applicable in methods 2, 3, and 5.