Process Facial Recognition And Liveness From Files
The purpose of this endpoint is to perform a comparison between two images - typically a selfie and an image taken from an identity document.
The endpoint verifies whether the person in both images is the same and allows performing a liveness check on the selfie image.
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
using var content = new MultipartFormDataContent();
content.Add(new ByteArrayContent(File.ReadAllBytes("portraitImage.jpg")), "portraitImage", "portraitImage.jpg");
content.Add(new ByteArrayContent(File.ReadAllBytes("selfieImage.jpg")), "selfieImage", "selfieImage.jpg");
var response = await client.PostAsync("{{API.SANDBOX_BASE_URL}}/Acuface/ProcessFacialRecognitionAndLivenessFromFiles", content);
var result = await response.Content.ReadAsStringAsync();
// Each *File below is a File or Blob holding the image.
const form = new FormData();
form.append("portraitImage", portraitImageFile);
form.append("selfieImage", selfieImageFile);
const response = await fetch("{{API.SANDBOX_BASE_URL}}/Acuface/ProcessFacialRecognitionAndLivenessFromFiles", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: form
});
const result = await response.json();