/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:
- Facial authentication between two open images:
- Generated or not by FacePhi widgets.
- Facial authentication between two biometric templates:
- Requires integration of FacePhi Selphi Mobile or Web widget.
- Facial authentication between an open image and a biometric template:
- Requires integration of FacePhi Selphi Mobile or Web widget.
- Facial authentication between the face present in the identity document photo (TokenFaceImage) and an open image:
- Requires integration of FacePhi SelphID Mobile widget.
- 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:
| Parameter | Type (Content) | Required | Description |
|---|---|---|---|
| token1 | String (Base64) | Yes | Image 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. |
| token2 | String (Base64) | Yes | Image used for the comparison. It can be an open image or a tokenized biometric template. |
| method | Integer | Yes | Indicates the comparison method invoked according to the following specification (methods 1 to 5): |
| tracking | JSON Object | No | Object that represents necessary tracking information. |
| extraData | String (Base64) | No | Token generated by Mobile/Web SDK. Contains tokenized tracking information with Platform. |
| operationId | String (Base64) | No | Operation identifier generated by Mobile/Web SDK. |
Method Specification
| Method | Description |
|---|---|
| Method = 1 | Facial authentication using open images (token1: Base64, token2: Base64) |
| Method = 2 | Facial authentication using biometric templates (token1: templateRaw, token2: templateRaw) |
| Method = 3 | Facial authentication using an open image and a biometric template (token1: Base64, token2: templateRaw) |
| Method = 4 | Facial authentication using the token generated by the crop of the document photo and an open image (token1: tokenFaceImage, token2: Base64) |
| Method = 5 | Facial 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:
| Identifier | Type | Description |
|---|---|---|
| serviceResultCode | Integer | Code indicating the overall result of the service execution. See Table 1 - Service Result Code |
| serviceTime | String | Total processing time (milliseconds). |
| serviceFacialAuthenticationResult | Integer | Code indicating the result of the facial matching. See Table 2 - Service Facial Authentication Result |
| serviceResultLog | String | Descriptive field of the service execution result. Includes details when there is an error or exception in the module. |
| serviceFacialSimilarityResult | Float | Value indicating the facial similarity between the face in the identity document photo and the selfie taken by the user. 1.0 = 100% |
| serviceTransactionId | String | Transaction identifier associated with the request processed by the API. |
| serviceFacialAuthenticationHash | String | Integrity hash of the biometric template used in a positive or uncertain facial authentication. Only applicable in methods 2, 3, and 5. |