Skip to main content

Facematch

This article explains how to check the authenticity of the photo on a document using the Unico Check REST API.

This method checks whether the photo on the document and the photo sent in the request are of the same person.

How to use it?

Make a POST request to the /faces/match endpoint

With a valid Access token, make a request to the endpoint (POST/faces/match) enviando os seguintes parâmetros:

{
"Base64Selfie": "FOTO_PESSOA",
"Base64Documento": "FOTO_DOCUMENTO"
}

Parameters:

  • HEADER PARAMETERS
NameTypeMandatory/OptionalDescription
APIKEYStringMandatoryAPI key
AuthorizationStringMandatoryAccess token
Content-TypeStringMandatory"application/json"
  • REQUEST BODY SCHEMA
NameTypeMandatory/OptionalDescription
Base64SelfieStringMandatorySelfie da pessoa. A imagem precisa ser em base64 (png, jpg, jpeg)
Base64DocumentoStringMandatoryFoto do documento. A imagem precisa ser em base64 (png, jpg, jpeg)

Request example:

Arquivo JSON
{
"Base64Selfie": "\"\"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAgSURBVDhPY/wPBAwUACYoTTYYNWDUABAYNWDgDWBgAABrygQclUTopgAAAABJRU5ErkJggg==\"\"",
"Base64Documento": "\"\"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAgSURBVDhPY/wPBAwUACYoTTYYNWDUABAYNWDgDWBgAABrygQclUTopgAAAABJRU5ErkJggg==\"\""
}

Successful request

If the request was executed successfully, the return response is a JSON containing the status of the check as follows:

{
"Status": true
}

The status is a boolean indicating whether the face in the document is the same as the one in the selfie that was sent.

Request error

If an error occurs, the return response is a JSON containing the error code and description:

{
"Error": {
"code": "40004",
"description": "Error description"
}
}

For more information on the errors returned, see the list available in the article Response Errors.

Any concerns?

Missing something or still need help? If you are already a customer or partner, you can contact us through the Help Center.