Skip to main content

CreateMessage

This article explains how to create a message process via the Unico Check REST API.

This method creates a message process (unsigned) containing the person's data.

How to use it?

Make a POST request to the /messages endpoint

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

{
"subject": {
"Code": "CPF_Titular",
"Name": "NOME_Titular",
"Gender": "GENERO_Titular",
"BirthDate": "DATANASCIMENTO_Titular",
"Email": "EMAIL_Titular",
"Phone": "PHONE_Titular"
},
"indexes": [
{
"key": "CPF_Titular",
"value": "NOME_Titular",
"page": "GENERO_Titular",
},
],
"template": "SELFIE_TRUE_FALSE",
"send": "WEBHOOK_URL",
"enableQRCode": "WEBHOOK_tokenAcesso"
}

Parameters:

  • HEADER PARAMETERS
NameTypeMandatory/OptionalDescription
APIKEYStringMandatoryAPI key
AuthorizationStringMandatoryAccess token
Content-TypeStringMandatory"application/json"
  • REQUEST BODY SCHEMA
NameTypeMandatory/OptionalDescription
subject.CodeStringMandatoryCPF válido
subject.NameStringMandatoryNome da pessoa
subject.GenderStringOptionalGênero da pessoa, podendo ser M ou F.
subject.BirthDateStringOptionalData de nascimento. String de 10 caracteres. Exemplo: 01/01/0001.
subject.EmailStringOptionalEmail da pessoa
subject.PhoneStringOptionalTelefone da pessoa
onlySelfieBooleanMandatoryInforma se é um processo que contém apenas a foto biométrica e se pode concluir o processo. Quando 'false' o processo tem 60 minutos para ser concluído (ficando com status 1 até a chamada do ExecuteProcess) ou será cancelado automaticamente.
webHookUrlStringOptionalUrl do endpoint para retorno do status (necessário ter configuração de webhook preexistente).
webHookSecretStringOptionalAccess token do endpoint de retorno.
imagebase64StringMandatoryFoto da pesssoa. A imagem precisa ser em base64 (png, jpg, jpeg)

Request example:

Arquivo JSON
{
"subject": {
"Code": "12345678910",
"Name": "Bob",
"Gender": "M",
"BirthDate": "01/01/0001",
"Email": "email@example.com",
"Phone": "5543999999999"
},
"onlySelfie": true,
"webHookUrl": "status.webhook.com",
"webHookSecret": "fo9graB5ids9",
"imagebase64": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAgSURBVDhPY/wPBAwUACYoTTYYNWDUABAYNWDgDWBgAABrygQclUTopgAAAABJRU5ErkJggg=="
}

Successful request

If the request was executed successfully, the return response is a JSON containing the transaction ID as follows:

{
"id": "6ab1771e-dfab-4e47-8316-2452268e5481"
}

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.