Face Validation
When you are creating the Web Flow, from the Validator Blocks you can select the Face Mach Block. This module allows you to validate the similarity between a reference face and the photo or video taken at the time of validation.
Prerequisites
In order to make the comparison between faces you must upload a base photo, which will be compared with the photo uploaded by your user.
To upload the base photo, please follow these steps:
-
Create an Enrollment
- Create a POST request to the endpoint
https://api.validations.truora.com/v1/enrollments
. - Set the following
key:value
pairs within the request body using theapplication/x-www-form-urlencoded
format:type
: [Required] to be set toface-recognition
user_authorized
: [Required] Indicates whether the person subject to the validation authorized the validation. Must betrue
in order to proceed.account_id
: The account_id is a unique value assigned to each user in the system to distinguish them and access their information and processes. Note that only Account IDs following the regex pattern [a-zA-Z0-9_.-]+ are supported. Please go to Create an Account ID to learn more about it.
You will receive a Response similar to the following:
- Create a POST request to the endpoint
Note:
- Enrollment
status
will be pending until asuccess
orfailure
Face Validation response is received. - The
account_id
,enrollment_id
andfile_upload_link
returned by this endpoint will be used in subsequent steps.
-
Upload Reference Photo
- Create a PUT request to the URL returned in the file_upload_link field of the previous step.
Response 200
- Create a PUT request to the URL returned in the file_upload_link field of the previous step.
-
Get Enrollment The enrollment status will be
success
orfailure
depending on the response provided by the Face Validation. Until the Face Validation is completed, the enrollment status will remain aspending
.- Create a GET request to the endpoint
https://api.validations.truora.com/v1/enrollments/{{enrollment_id}}
.
- Create a GET request to the endpoint
Face Match Block
Now add the Face Match Block to your flow and choose the method with which you want to perform the face matching:
-
Video Selfie: The user must upload a short video looking at the camara, without instructions. Formats supported are: webm, mp4, avi, and mov. Maximum size is 10 MB Recommended for: WhatsApp, API integration, Web.
-
Guided video The user must upload a short following some instructions (e.g: look up, look down, look right). Formats supported are: webm, mp4, avi, and mov. Maximum size is 30 MB. Recommended for: WhatsApp, Web.[Deprecated] -
Photo The user must take a picture of his or her face. formats supported are: jpeg, png and webp. Maximum size is 10 MB. Recommended for: API integration, Web.
Properties
- Threshold: Similarity between the provided picture and video that is required to pass the validation from 0 to 1. By default, the treshold is set to 0.65.
-
Additionally:
-
You can configure others parameters to improve the behavior of the validators and the user experience. Please see Config Validator Guide for more information on customization.
-
If face recognition fails you can see declined reason here: **Face Recognition declined reason.
-
Remember also you could customize your web flow. For more information please visit Customize Web Flow guide.
-
Integrating Your Flow
Once you have finished and testing the Flow, you need to integrate it. Please check out the following guide for more information: How to create a Web Integration Token
Note: Please keep in mind that at this point you may be asked for the account_id
parameter with which you performed the enrollment process.
Get Results of Validation
-
You can get the validation results with a query to the Truora’s API or from the dashboard. For more information, please see Guide to Get Results.
-
The information about the results of the validations made to the user can be notified through Webhooks. This alternative allows you to receive hooks of the actions/rules created.