Only this pageAll pages
Powered by GitBook
1 of 94

English (United States)

Loading...

GETTING STARTED

Loading...

Loading...

Loading...

Loading...

INTEGRATIONS

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API

In this section, you will find everything related the REST APIs for using the by Unico integration method

API Reference

In this section, you will find all available REST APIs for using the by Unico integration method

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Controlling the experience

In this section, you will find the experience components that can be used with by Unico

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API

In this section, you will find everything related the REST APIs for using the by Client integration method

API Reference

In this section, you will find all the available REST APIs for using the by Client integration method

Loading...

Loading...

Loading...

Loading...

Loading...

Additional Resources

In this section, you will find additional resources related to the by Client integration method

Loading...

Loading...

Loading...

SDK

In this section, you will find all the technical specifications of the available SDKs from the Unico IDCloud platform

Loading...

Loading...

SDK Integration

In this section, you will find all the necessary information to implement the SDKs of the Unico IDCloud platform

Android SDK

In this section, you will find all the necessary information to implement the Android SDK of the Unico IDCloud platform

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

iOS SDK

In this section, you will find all the necessary information to implement the Unico IDCloud platform's iOS SDK

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Flutter SDK

Nesta seção, você encontrará todas as informações necessárias pra implementar o SDK Flutter da plataforma Unico IDCloud

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Web SDK

In this section, you will find all the necessary information to implement the Web SDK of the Unico IDCloud platform

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Additional Resources

In this section, you will find additional resources related to the SDK

Loading...

Loading...

help & faq

Loading...

Authentication

In this section, you will find the full technical specifications for the authentication method required to use the IDCloud platform’s REST APIs


To use the IDCloud platform, it is necessary to authenticate via an access token, using the authentication system known as OAuth2.

The OAuth2 authentication system from Unico supports server-to-server interaction between a web application and Unico's services.

For this scenario, you will need a service account, which is an impersonal account belonging to your application and not to an individual user. Your application calls Unico’s APIs on behalf of the service account, so users are not directly involved. This scenario is called “two-legged OAuth,” or “2LO.” Typically, an application uses a service account when the application calls Unico’s APIs to work with its own data rather than user data.

This is step zero to begin your implementation; therefore, do not skip this step.


Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

​
Help Center

Capabilities and Integration Methods

In this section, you will find which capabilities are available for each integration method of the Unico IDCloud platform


To meet the various use cases of your operation, the capabilities of IDCloud have different availability depending on the integration methods. Below, check out the table with all the usage possibilities, separated by integration method:

  • In each integration method, it is possible to combine various capabilities with each other. To learn more about the possible flows in each integration method, access the respective menus below:

  • For both integration methods, it is also possible to obtain the similarity response from Serpro.


Capacidades
by Unico
by Client

Identity Verification

Risk Score

Behavior Alert

Liveness

Validation (1:1)

Document Capture and Reuse

Electronic Signature

;

.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

by Unico
by Client
​
Help Center

Welcome

Here you will find the technical information for the Unico IDCloud platform's REST APIs


Overview


Welcome to the Unico IDCloud platform REST API documentation! On this page, you'll find everything you need to know to enhance the security and quality of your applications using our REST API.

Learn more about



Unico IDCloud

Learn all about our Unico IDCloud identity verification platform


What is the Unico IDCloud platform?


IDCloud is the only identity verification platform that combines security with guaranteed accuracy. With it, you can validate user identities in a simple and intuitive way, using only a selfie, ensuring smoothness and protection in your verification processes.

To learn more about our capabilities, visit the following page:


Additional Resources

In this section, you will find additional resources related to authentication


Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

The platform is versatile and can be adapted to different use cases, allowing you to adjust it according to your scenario's needs. To do so, we offer various —features of our platform that cater to a wide range of operations and demands. You can use the IDCloud platform through two integration methods:

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

☁ About IDCloud

Start your reading by learning more about the IDCloud platform.

🔑 About Authentication

See the technical specifications for authentication to use the IDCloud platform APIs.

🔒 About APIs

See the technical specifications for the IDCloud platform APIs.

⚙ About SDKs

See the step-by-step guide to implement the IDCloud SDK for by Client.

​
Help Center
capabilities
by Unico and by Client.
​
Help Center

Integration by Unico

In this section, you will find all technical specifications for the Unico IDCloud platform's REST APIs, using the by Unico integration method.

Postman Collection
Example in Javascript
Authentication Errors
FAQ Autenticação

Quickstart

In this section, you will find an overview of how to integrate with the Unico IDCloud platform


Integration Overview


1

Authenticate

2

Define the Capabilities You Will Use

What capabilities do you need for your operation? Identity Verification? Liveness?

3

Define Your Integration Method

4

Create a Process

5

Check the Process Result

Once the process is complete, check the result in the integration method you chose.

Done. With the result in hand, make the decision to approve or deny the user's registration.


Preparing to Make an Authenticated API Request

In this section, you’ll find instructions on how to complete the authentication process on the Unico IDCloud platform


After creating and configuring a service account, your application needs to complete the following steps:

  1. Create a JSON Web Token (JWT), which includes the header, payload, and signature.

  2. Request an Access Token from the OAuth2 authentication platform.

  3. Process the JSON response returned by the authentication platform.

If the response includes an access token, you can use it to make requests to Unico product APIs for which the service account has access permissions. (If the response does not include an access token, your JWT or token request may be incorrect, or the service account might lack the necessary permissions to access the requested resources.)

The access token generated in the above request has a default validity of 3600 seconds, but this may vary based on the security configuration set for your company. When the access token expires, your application must generate a new JWT, sign it, and request a new access token from the authentication platform.

1 - Creating the JWT


A JWT (JSON Web Token) consists of three parts: a header, a payload, and a signature. The header and payload are JSON objects, which are serialized in UTF-8 and then encoded using Base64url encoding. This encoding ensures resilience against modifications due to repeated encoding operations. The header, payload, and signature are concatenated using a period (.) separator.

A JWT is structured as follows:

{Header in Base64url}.{Payload in Base64url}.{Signature in Base64url}

The base text for the signature is formed in the following way:

{Header in Base64url}.{Payload em Base64url}

1.1 - Forming the JWT Header


The header consists of two fields that specify the signing algorithm and the token format. Both fields are mandatory, and each field has only one value. Service accounts rely on the RSA SHA-256 algorithm and the JWT token format.

As a result, the JSON representation of the header is as follows:

{"alg":"RS256","typ":"JWT"}

The Base64url representation is as follows:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9

This ensures that both header and payload are properly encoded before signing, which is crucial for secure authentication.

1.2 - Forming the JWT Payload


The JWT payload contains information about the JWT, including the requested permissions (scopes), the account requesting access, the issuer, the time the token was issued, and the token's lifespan. Most fields are mandatory. Like the JWT header, the payload is a JSON object and is used in the composition of the signature.

1.3 - Required Fields


The required fields in the JWT are shown in the table below. They can appear in any order within the payload.

Name
Description

iss

The identifier of the service account within the company.

scope

A space-delimited list or a list separated by the plus sign (+) of the permissions that the application is requesting. If all permissions of the account are required, use the asterisk sign (*) for that purpose.

aud

exp

The expiration time of the token, specified in seconds since 00:00:00 UTC, January 1, 1970. This value has a maximum time of 1 hour after the moment of issuing the JWT. This value must be numeric. Common cases that DO NOT work:

  • Using quotes to delimit the value. For example: “1524161193” is a string and will not work. However, 1524161193 is a number and will work.

iat

The moment of issuing the JWT, specified in seconds since 00:00:00 UTC, January 1, 1970. This value must be numeric.

  • Using quotes to delimit the value. For example: “1524161193” is a string and will not work. However, 1524161193 is a number and will work.

Understand how the conversion works for the issuance (iat) and expiration (exp) fields of the JWT, and also see examples of how to use the values of these fields here. Additionally, the "iat" field should reflect the current time in the required format, and the "exp" field must adhere to the calculation below:

exp = iat + 3600

The representation of the mandatory JSON fields in the JWT payload is as follows:

{
  "iss": "service_account_name@tenant_id.iam.acesso.io",
  "aud": "https://identityhomolog.acesso.io",
  "scope": "*",
  "exp": 1626296976, //This is just an example. Use the current value generated here.
  "iat": 1626293376 //This is just an example. Use the current value generated here.
}

1.4 - Calculating the Signature


The JSON Web Signature (JWS) specification is the mechanism that guides the calculation of the signature for a JWT. The input content for the signature calculation is the byte array of the following content:

{Header in Base64url}.{Payload in Base64url}

The same algorithm specified in the header of the JWT must be used for the signature calculation. The only signature algorithm supported by the OAuth2 authentication platform is RSA using SHA-256. It is expressed as RS256 in the alg field of the JWT header.

Sign the UTF-8 representation of the input content using SHA256withRSA (also known as RSASSA-PKCS1-V1_5-SIGN with SHA-256 hash) with the private key that was created and associated with the service account (the .key.pem file generated from the request received by email). The output content will be a byte array.

The signature must then be encoded in Base64url. The header, payload, and signature must be concatenated with a period (.). The result is the JWT. It should be in the following format: {Header in Base64url}.{Payload in Base64url}.{Signature in Base64url} Below is an example of a JWT token before Base64url encoding:

{Header in Base64url}.{Payload in Base64url}.{Signature in Base64url}

Below is an example of a JWT token before Base64url encoding:

{"alg":"RS256","typ":"JWT"}.
{
  "iss": "service_account_name@tenant_id.iam.acesso.io",
  "aud": "https://identityhomolog.acesso.io",
  "scope": "*",
  "exp": 1626296976, //This is just an example. Use the current value generated here.
  "iat": 1626293376 //This is just an example. Use the current value generated here.
}.
[byte array from signature]

Below is an example of the JWT that has been signed and is ready for transmission:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzZXJ2aWNlX2FjY291bnRf
bmFtZUB0ZW5hbnRfaWQuaWFtLmFjZXNzby5pbyIsImF1ZCI6Imh0dHBzOi8vaWRlbnRpdHlob21vbG9nLmFjZXNzby5pbyIsInNjb
3BlIjoiKiIsImV4cCI6MTYyNjI5Njk3NiwiaWF0IjoxNjI2MjkzMzc2fQ.JsymP3NZdgCSqeNlgsOM2
-AQ7M450NxFnZnnaKSu4Q8g12QGEIvvM4EhCokUHfwk5s7pOpm2UD_Ng3Hb5g_wgrjfiVSLWH5Q2wYg1AvfLqo
YSoJWaMHm9KL0kpv32XdDD8TZVR-MVd2VBHmCMVbV6gvk8buUoK1HZDN7g84PaY3bfgcB3RKU-
H55lR8yyJjZxToIv17-wfla2G99uaMEFNGX0ZSE7ETn5Z8-WypmFrNAK0TM58upzvfVI6_-
gY4cj4iQvmRbuvxsAaGiHA2xd0RVm2Mrx-gQtdPqtbZPuQcH7k64Z_EOQBgiGTgVjucyHD6zBijr_P-
2mhIxuecNSw

2 - Making a Request for an Access Token


After generating the signed JWT, an application can use it to request an access token. The access token request is a POST HTTPS request, and the body must be URL encoded. The URL is as follows:

https://identityhomolog.acesso.io/oauth2/token

The parameters below are mandatory in the request:

Name
Description

grant_type

Use the following text, URL-encoded if necessary: urn:ietf:params:oauth:grant-type:jwt-bearer.

assertion

The JWT, including the signature.

POST /oauth2/token HTTP/1.1
Host: identityhomolog.acesso.io
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-
bearer&assertion=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzZXJ2aWNlX2FjY
291bnRfbmFtZUB0ZW5hbnRfaWQuaWFtLmFjZXNzby5pbyIsInN1YiI6InVzZXJfaWRlbnRpZmllciIs
ImF1ZCI6Imh0dHBzOi8vaWRlbnRpdHlob21vbG9nLmFjZXNzby5pbyIsInNjb3BlIjoiKiIsImV4cCI
6MTMyODU1NDM4NSwiaWF0IjoxMzI4NTUwNzg1fQ.TjH-mTtwP6tBB93O1sDPaAA6yUF7N2-HZDlpIPz
bf_dxO8A6KZuRWG8ZnICrxX56qj0HREiMlYy27XJgxowrUa0JHvbqc8HJkT7-6Mh7J67UnubZKG1-hi
6jDtkC9BIXBcOhtkNUfZvZetXjLzsRsSDkqxdMtzYZwkRlocvaxL5QXiQhweeEwK_Ux81Adh3z0EIhT
yl7CKJLJ69PuHS7s9IdrjUl79owipp4LF1FvtMhoe7YIL69ohPgFqSv_-Y9qpPdW6be3OEAyKlOM08S
ZBbHBwW4XMvw3uZjTY1sgJ4cBoxrftDpjYOw34oPOKxirqc5-90uOCYe1O1hRtG45w


If the JWT and the access token request were properly formed and the service account has the necessary permissions, then the response from the authentication platform returns a JSON object containing an access token. Here’s an example of a response from the platform:

{
  "access_token": "<access_token>",
  "token_type": "Bearer",
  "expires_in": "3600"
}

4 - The duration of the access token


The duration of the access token is variable. Its duration is specified in the "expires_in" field, returned along with the access token. The same access token should be used during its validity for all calls to the product APIs.

Do not request a new access token until the validity of the current token is nearing its end. We recommend a margin of 600 seconds (10 minutes). To do this, perform the calculation:

decoded token:
new Date(token.exp - 600)

Where token.exp is the timestamp of the token's expiration.

By default, the token sent to the company is valid for 1 hour, but this can be changed. It is recommended to always use the expires_in as a reference and subtract 600 seconds from it to request a new token.

Examples:

Standard scenario:
expires_in: 3600 (1h) - Token generation at 2:42 PM

Request a new token only at 3:32, that is, 2:42 + (3600 - 600)
Scenario with altered duration:
expires_in: 7200 (2h) - Token generation at 2:42 PM

Request a new token only at 4:32, that is, 2:42 + (7200 - 600)

A new access token can be requested when there are 10 minutes left until expiration.

Do not use a fixed time to obtain a new token, as the duration of the received token may be shorter than the established time, which will result in service usage failures.

  • ¹ According to RFC 4648 for BaseN encoding, the Base64url format is similar to the Base64 format, except that the character = should be omitted, and the characters + and / should be replaced with - and _, respectively.


Capabilities

In this section, you will find a description of all the capabilities of the Unico IDCloud platform

Below, you will find a detailed explanation of how each capability works:

Liveness


When there is a need to verify if the person is real and alive at the time of the operation, it can be used either independently or in conjunction with the capabilities of Identity Verification, Behavior Alert, Risk Score, and Validation (1:1). It should always be used in conjunction with the SDKs.

The possible responses are:

  • YES: indicates that the user is alive at the moment the selfie is captured.

  • NO: indicates that the user is not alive at the moment the selfie is captured.

Commonly referred to as IDLive or Smartlive/Liveness with Interaction.


Identity Verification


When there is a need to ensure that the user performing the process is who they claim to be, it is by default always used in conjunction with the Liveness capability.

The possible responses are:

  • YES: indicates that the face belongs to the actual holder of the CPF (Cadastro de Pessoas Físicas).

  • NO: indicates that the face does not belong to the actual holder of the CPF.

  • INCONCLUSIVE: indicates that there is insufficient evidence to determine whether the face belongs to the actual holder of the CPF.

Commonly referred to as IDUnico.


Behavior Alert


The Behavior Alert complements the Identity Verification response by adding the behavior component, which provides certainty about a risk associated with that identity, based on previous fraudulent behavior. It can only be used in conjunction with the Identity Verification capability.

The possible responses are:

  • YES: indicates that the face has been involved in fraudulent identity transactions.

  • INCONCLUSIVE: indicates that there is insufficient evidence to suggest that the face is involved in fraudulent transactions in our database.

Commonly referred to as Trust or IDTrust.


Risk Score


The Risk Score capability is being deprecated and can only be used in exceptional cases. To verify the eligibility of your case, please contact the person responsible for your account.

When there is a need to obtain a probability score about whether the user performing the process is who they claim to be, it can only be used in orchestration with the Identity Verification capability when the response is "INCONCLUSIVE."

The possible responses are:

  • Positive Score: can range from +10 to +100. The higher the score, the greater the probability that the face belongs to the actual holder of the CPF. (Cadastro de Pessoas Físicas).

  • Zero Score: indicates a registration error. We recommend a new capture be taken.

  • Negative Score: can range from -10 to -100. The lower the score, the greater the probability that the face does not belong to the actual holder of the CPF.

Classification
Score
Recommendation

Negative

Between -40 and -100

We recommend denying the registration

Negative

Between -10 and -39

We recommend that the client assess the associated risks before making a decision

Neutral

Zero Score

We recommend denying the registration and asking the user to capture a new photo of the actual holder of the CPF

Positive

Between +10 and +49

We recommend that the client evaluate the risks involved in making a decision

Positive

Between +50 and +100

We recommend approving the registration

Commonly referred to as Check or Unico Check.


Validation (1:1)


When there is a need to recognize if the person in the operation is the same one who completed the registration, it is by default always used in conjunction with the Liveness capability. It can only be used in cases where an Identity Verification process has already been completed.

The possible responses are:

  • YES: indicates that the face performing the transaction is the same as the one that completed the process used as a reference.

  • NO: indicates that the face performing the transaction is not the same as the one that completed the process used as a reference.

Commonly referred to as Biometric Token or Transactional Token.


Document Capture and Reuse


When there is a need to request, store, and reuse documents, we offer the ability to leverage users' personal documents (Passport, CIN, RG, and CNH—both digital and physical), reducing friction. If we do not have the documents in our database, it is possible to capture them.

This capability can only be used in conjunction with the Identity Verification capability. For document validation, we use the following technologies:

  • Typification: indicates whether the provided document is valid or not.

  • OCR: involves extracting data from the document based on an image.

  • FaceMatch: involves comparing the face in the selfie with the face on the document.

  • CPF Match: involves searching for a specific CPF in the provided document.

Commonly referred to as IDDOCS.


Electronic Signature


When there is a need to use biometrics to sign a document, utilize the same method of user authentication throughout the journey to finalize the operation with the contract signature.

*The electronic signature capability is only available through the by Unico integration mode in flows that involve other capabilities.

Commonly referred to as SIGN or IDSIGN.


Serpro Similarity Return


The Serpro similarity return is not a native capability of IDCloud but rather an additional feature incorporated to comply with a regulation from Dataprev concerning INSS payroll credit operations aimed at retirees and pensioners.

Since these operations require the SERPRO similarity return, the IDCloud platform has been adjusted to include this functionality as an option in the product. When using the SERPRO similarity feature, the API response will be the score of similarity.

Commonly referred to as IDSerpro.

  • When Serpro finds the face, it returns a score from 0-100, as in the example below:

"government": {
        "serpro": 93.0
    }
  • When Serpro does not find the face, the score -1 is returned, as in the example below:

"government": {
        "serpro":-1
    }
  • When there is an error in the integration with Serpro, the score -2 is returned, as in the example below:

"government": {
        "serpro":-2
    }

To understand how you can use each of the capabilities, be sure to visit the "Integration Methods" section at the link below:


Creating a Service Account

In this section, you will find instructions on how to create a service account to authenticate with the Unico IDCloud platform.


To use server-to-server interactions, you need to request the creation of a service account through the project manager responsible for your company by providing the following information: company name, application name, name, email, and phone number of the person responsible for the application within the company. Separate accounts are required for the Homologation and Production environments.

Once this information is received, a service account responsible for authenticating your application will be created, and an email will be sent to generate the key pair for the account.

A service account credential includes a unique account name, a company identifier (Tenant ID), and at least one key pair (public and private). After generating the keys, you will only receive the private key (a .key.pem file) along with the payload that must be used to construct the JWT. This payload will follow the format below:

If you need the public key to configure it in your system, contact the project manager responsible for your account. It is also possible to generate a public key using the following openssl command:


Postman Collection

In this section, you will find the Postman collection for the REST API to authenticate on the Unico IDCloud platform


Download the file below, import it into Postman, and replace the values of the parameters "service_account," "tenant_id," and "secret_key" to test the request.


Example in Javascript

In this section, you will find an example of implementing authentication for the Unico IDCloud platform in JavaScript



CreateProcess

In this section, you will find how to create a process in Unico via the REST API


Introduction


In this section, you will find detailed documentation on how the Process Creation endpoint works in by Unico. Note that to utilize the capabilities of the IDCloud platform in this integration method, you only need to change the value of the "flow" parameter when creating the process. Unico will handle the orchestration of all the desired capabilities.

Learn more about using capabilities in by Unico in the Overview section.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:


Process Creation


Processes must be created exclusively through backend-to-backend communication, due to our CORS policy, which prevents processes from being created through frontend-to-backend communication.

The requirement for parameters in process creation may change depending on the flows used. For example:

  • In flows that involve Electronic Signature, it is mandatory to send the payload object and all its properties;

  • In flows that involve Validation (1:1), it is mandatory to send the bioTokenId property.

Tips:

  • For more information about the possible errors for this endpoint, refer to the Errors section.


Authentication Errors

In this section, you will find the possible errors that may occur when trying to authenticate on the Unico IDCloud platform.


The errors returned in the request can be identified by the codes below and have the following structure:


CreateProcess separated by flows

In this section, you will find examples of CreateProcess requests in Unico


Requests separated by flows


Other ways to make a request


To use Postman, follow these steps:

  • Select the POST method.

  • Enter the URL https://api.cadastro.uat.unico.app/client/v1/process/.

  • Select the Authorization tab.

  • From the Type dropdown list, choose Bearer Token.

  • Enter the obtained token in the Token field with the prefix Bearer.

  • Select the Body tab and enter the data below according to your requirements.


Integration Methods

In this section, you will learn more about the integration methods of the Unico IDCloud platform


by Unico


For companies that wish to have a partner to manage the user experience with best practices and privacy, as well as the ease of orchestrating flows with Unico's capabilities and automatic technology updates, such as SDKs.

With by Unico, you will have a team of security experts and UX design best practices to ensure the best possible conversion in your operation. It can be used responsively on both Desktop and Mobile. Offering the following usage possibilities:

For the message flow, it is possible to send notifications through the channels of WhatsApp and/or SMS.

Check out the end-user experience with by Unico in Messaging, Webview, and iFrame, respectively, in the tabs below:


by Client


For companies that wish to control the user experience with their own frontend, as well as build flows using Unico’s capabilities on the backend alongside other technologies and resources used for authentication.

With by Client, you have the freedom you need to create and manage the end-user journey as you see fit, leveraging the capabilities of the Unico IDCloud platform as necessary.


Regardless of the integration method you choose, the first step is . You must have a service account and perform OAuth2 authentication to obtain a valid access token.

Learn more in the section.

Understand the available on the Unico IDCloud platform and decide which ones you will utilize in your operation.

Learn more in the section.

Do you want the convenience of ? Or the freedom of?

Based on the you will use, define your integration method according to your operation and context.

Learn more in the section.

Opted for ?

and define where the end user's journey will take place.

Prefer to go with ?

Capture the end user's selfie using our and create a process.

To optimize your integration, you can use the and know when the result of your process is completed.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Address of the authentication platform that issues access tokens. This value must always and exactly be Common cases that DO NOT work:

Inserting a trailing slash at the end of the address:

Using the HTTP protocol instead of HTTPS:

It is also possible to use pre-established libraries to create the JWT. As a reference, you can find a list of libraries on the website.

3 - Handling the response from the authentication platform

The access token returned in the “access_token” field of the JSON object is also a JWT that should be used for the APIs of Unico’s products. If an error occurs in the request, you can check the type of error in the error table by clicking .

² JSON Web Signature: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Produção: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Name
Description

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This payload is used to create the following flows:

  • idlive / id / idlivetrust / idtrust / idcheck / iddocs / idchecktrust / idchecktrustdocs / idcheckserpro / idcheckserprodocs.

This payload is used to create the following flows:

  • idsign / iddocssign / idchecktrustsign / idchecktrustdocssign / creditoconsignado / idcheckserprodocssign / idtrustdocssign / idunicodocssign.

This payload is used to create the following flows:

  • idtoken / idtokentrust.

This payload is used to create the following flows:

  • idtokensign.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Channel
Redirect
Open.window()
iFrame
Webview
Mensagens

Check out the end-user selfie capture experience with by Client using Unico’s :

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Authentication
Authentication
capabilities
Capabilities
by Unico
by Client
capabilities
Integration Methods
by Unico
Create a process
by Client
SDKs
Webhook
​
Help Center
jwt.io
​
here
https://tools.ietf.org/html/rfc7515
​
Help Center

Liveness

Identity Verification

Behavior Alert

Risk Score

Validation (1:1)

Document Capture and Reuse

Electronic Signature

+Serpro similarity return

​
Help Center
openssl req -x509 -new -nodes -sha256 -days 720 \
-key fileName.key.pem -out fileName.cert.pem
LogoCapabilities | Unico IDCloud - DevCenter
const fs = require('fs')
const path = require('path')
const jwt = require('jsonwebtoken')
const request = require('request')

// settings
const basePath = 'https://identityhomolog.acesso.io'

// entry point
let options = {
    serviceAccount: 'svcapp1',
    tenant: "9ea3c3bd-4447-4c3b-ae2e-504b795d3733"
}

requestAnAccessToken(createServiceAccountToken(options), (err, accessToken) => {
    let payload = jwt.decode(accessToken.access_token)
    console.log('Response:')
    console.log(' Access Token: ', accessToken.access_token)
    console.log(' ID: ', payload.jti)
    console.log(' Issuer: ', payload.iss)
    console.log(' Subject: ', payload.sub)
    console.log(' expires_in: ', accessToken.expires_in)
    console.log(' Expiration Date: ', new Date(payload.exp))
    console.log(' Creation Date: ', new Date(payload.iat))
})

// functions
function createServiceAccountToken({tenant, serviceAccount, account = ''}) {
    // Reads the service account private key
    let privateKey = fs.readFileSync(path.resolve(`${serviceAccount}.key.pem`))

    // Prepare the request
    let payload = {
        iss: `${serviceAccount}@${tenant}.iam.acesso.io`,
        aud: basePath,
        scope: '*',
        exp: Math.floor(Date.now() / 1000) + 3600,
        iat: Math.floor(Date.now() / 1000)
    }
    // Service account is requesting an access token for another user?
    if (account) {
        payload.sub = account
    }

    // Create JWS
    return jwt.sign(payload, privateKey, { algorithm: 'RS256' })
}

function requestAnAccessToken(serviceToken, callback) {
    // Prepare the request
    let options = {
        method: 'POST',
        url: `${basePath}/oauth2/token`,
        headers: {'content-type': 'application/x-www-form-urlencoded'},
        form: {
            grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer' ,
            assertion: serviceToken
        }
    }
    console.log('Requesting Access Token with self created token:' )
    console.log('', serviceToken)

    // Ask identity and authorization server for an access token
    request(options, (error, response, body) => {
        if (error) {
            callback(new Error(error))
        }

        body = JSON.parse(body)

        if (body.error) {
            callback(new Error(`${body.error}: ${body.error_description}`))
        }

        callback(null, body)
    })
}
{
  "error": "server_error",
  "error_description": "Falha na autenticação x.x.x"
}

1.0.1

Check if the ID provided in the formation of "iss" is the correct tenant ID given during the generation of the private key.

1.0.14

Check with the project manager if the application being used is active.

1.1.1

The "scope" parameter was not provided in the payload of the JWT used in the request.

1.2.4

The JWT used in the request has expired. Check the value specified in the "exp" field of the payload.

1.2.5

The JWT used in the request cannot be validated. Verify the parameters provided and ensure that it was signed correctly.

1.2.6

The private key used to sign the JWT in the request is no longer acceptable. Request new credentials for the account used.

1.2.7

The JWT used in the request is no longer acceptable as it has already been used. Generate a new token to make a new request.

1.2.11

The account used is not active.

1.2.14

The account used does not have the necessary permissions.

1.2.18

The account used has been temporarily locked due to exceeding the number of invalid authentication attempts.

1.2.19

The account used is not authorized to impersonate another user account (remove the "sub" parameter from the payload).

1.2.20 1.2.21

Failed to decode the JWT used in the request. Use a new token by including only the fields specified in the "Mandatory Fields" and "Additional Fields" sections, adhering to the naming, semantics, and type of each field.

1.2.22

The JWT used in the request contains additional fields in the payload that are not allowed. Use a new token by including only the fields specified in the "Mandatory Fields" and "Additional Fields" sections, adhering to the naming, semantics, and type of each field.

1.3.1

The account used has source IP restrictions.

1.3.2

The account used has access date/time restrictions.

{
  "callbackUri": "/path/to/url",
  "flow": "idlive", //this flow is just an example
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "73689290074",
    "friendlyName": "Luke Skywalker",
    "phone": "5511974749090",
    "email": "luke@unico.io",
    "notifications":
    [
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
      },
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_SMS"
      }
    ]
  },
  "purpose": "biometryonboarding",
  "expiresIn": "3600s"
}
{
  "callbackUri": "/path/to/url",
  "flow": "idunicosign", //this flow is just an example
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "73689290074",
    "friendlyName": "Luke Skywalker",
    "phone": "5511974749090",
    "email": "luke@unico.io",
    "notifications": 
    [
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
      },
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_SMS"
      }
    ]
  },
  "purpose": "biometryonboarding",
  "expiresIn": "3600s",
  "payload": [
    {
      "envelopePayload": {
        "documents": [
          {
            "documentName": "teste",
            "fileContents": "JVBERi0xLjMNCiXi48/[...]DKJSVFT0YNCg=="
          }
        ]
      }
    }
  ]
}
{
  "callbackUri": "/path/to/url",
  "flow": "idtoken", //this flow is just an example
  "bioTokenId": "339f9225-6f09-4303-9688-bf35944787e1",
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "73689290074"
    "friendlyName": "Luke Skywalker",
    "phone": "5511974749090",
    "email": "luke@unico.io",
    "notifications": 
    [
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
      },
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_SMS"
      }
    ]
  },
  "purpose": "biometryonboarding",
  "expiresIn": "3600s"
}
{
  "callbackUri": "/path/to/url",
  "flow": "idtoken", //this flow is just an example
  "bioTokenId": "339f9225-6f09-4303-9688-bf35944787e1",
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "73689290074"
    "friendlyName": "Luke Skywalker",
    "phone": "5511974749090",
    "email": "luke@unico.io",
    "notifications": 
    [
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
      },
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_SMS"
      }
    ]
  },
  "purpose": "biometryonboarding",
  "expiresIn": "3600s",
  "payload": [
    {
      "envelopePayload": {
        "documents": [
          {
            "documentName": "teste",
            "fileContents": "JVBERi0xLjMNCiXi48/[...]DKJSVFT0YNCg=="
          }
        ]
      }
    }
  ]
curl -X 'POST' \
  'https://api.cadastro.uat.unico.app/client/v1/process/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{TOKEN}}'
  -d '{
    "callbackUri": "/",
    "flow": "id",
    "person": {
        "duiType": "DUI_TYPE_BR_CPF",
        "duiValue": "73689290074",
    "friendlyName": "John Doe"
    },
    "purpose": "creditprocess"
}'
{
  "callbackUri": "/paht/callback-url",
  "flow": "id",
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "73689290074",
    "friendlyName": "John Doe"
  },
  "purpose": "creditprocess"
}
const axios = require("axios");

const apiUrl = "https://api.cadastro.uat.unico.app/client/v1/process/";
const token =  "<YOUR_TOKEN_HERE>";

const requestData = {
  callbackUri: "/path/to/url",
  flow: "id",
  person: {
    duiType: "DUI_TYPE_BR_CPF",
    duiValue: "73689290074",
    friendlyName: "John Doe",
  },
  purpose: "creditprocess",
};

const headers = {
  "Content-Type": "application/json",
  Authorization: `Bearer ${token}`,
  accept: "application/json",
};

axios
  .post(apiUrl, requestData, { headers })
  .then((response) => {
    console.log("Resposta da API:", response.data);
  })
  .catch((error) => {
    console.error("Erro:", error);
  });
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        String apiUrl = "https://api.cadastro.uat.unico.app/client/v1/process/";
        String token = "<YOUR_TOKEN_HERE>";

        // Crie o corpo da solicitação em formato JSON
        String requestBody = "{\"callbackUri\":\"/\",\"flow\":\"id\",\"person\":{\"duiType\":\"DUI_TYPE_BR_CPF\",\"duiValue\":\"73689290074\"},\"purpose\":\"creditprocess\"}";

        // Configure os cabeçalhos da solicitação
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        headers.put("Authorization", "Bearer " + token);
        headers.put("accept", "application/json");

        // Crie a instância do HttpClient
        HttpClient httpClient = HttpClient.newBuilder().build();

        // Crie a solicitação HTTP POST
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(apiUrl))
                .headers(headers.entrySet().stream()
                        .map(e -> e.getKey() + ":" + e.getValue())
                        .toArray(String[]::new))
                .POST(HttpRequest.BodyPublishers.ofString(requestBody))
                .build();

        try {
            // Envie a solicitação e obtenha a resposta
            HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());

            // Exiba a resposta da API
            System.out.println("Status da resposta: " + response.statusCode());
            System.out.println("Corpo da resposta: " + response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        string apiUrl = "https://api.cadastro.uat.unico.app/client/v1/process/";
        string token = "<YOUR_TOKEN_HERE>";

        string requestBody = "{\"callbackUri\":\"/\",\"flow\":\"id\",\"person\":{\"duiType\":\"DUI_TYPE_BR_CPF\",\"duiValue\":\"73689290074\"},\"purpose\":\"creditprocess\"}";

        HttpClient client = new HttpClient();
        client.DefaultRequestHeaders.Add("Content-Type", "application/json");
        client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
        client.DefaultRequestHeaders.Add("accept", "application/json");

        try
        {
            HttpResponseMessage response = await client.PostAsync(apiUrl, new StringContent(requestBody, Encoding.UTF8, "application/json"));

            if (response.IsSuccessStatusCode)
            {
                string responseBody = await response.Content.ReadAsStringAsync();
                Console.WriteLine("Status da resposta: " + response.StatusCode);
                Console.WriteLine("Corpo da resposta: " + responseBody);
            }
            else
            {
                Console.WriteLine("Erro na solicitação. Status da resposta: " + response.StatusCode);
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("Erro: " + e.Message);
        }
    }
}
package main

import (
    "bytes"
    "fmt"
    "net/http"
)

func main() {
    apiURL := "https://api.cadastro.uat.unico.app/client/v1/process/"
    token := "<YOUR_TOKEN_HERE>";

    // Crie o corpo da solicitação em formato JSON
    requestBody := []byte(`{
        "callbackUri": "/path/to/url",
        "flow": "id",
        "person": {
            "duiType": "DUI_TYPE_BR_CPF",
            "duiValue": "73689290074"
        },
        "purpose": "creditprocess"
    }`)

    // Crie um cliente HTTP
    client := &http.Client{}

    // Crie uma solicitação HTTP POST
    req, err := http.NewRequest("POST", apiURL, bytes.NewBuffer(requestBody))
    if err != nil {
        fmt.Println("Erro ao criar a solicitação HTTP:", err)
        return
    }

    // Defina os cabeçalhos da solicitação
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer "+token)
    req.Header.Set("accept", "application/json")

    // Faça a solicitação HTTP
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Erro ao fazer a solicitação HTTP:", err)
        return
    }
    defer resp.Body.Close()

    // Verifique o status da resposta
    if resp.StatusCode == http.StatusOK {
        // Leitura do corpo da resposta
        var responseBody []byte
        _, err := resp.Body.Read(responseBody)
        if err != nil {
            fmt.Println("Erro ao ler o corpo da resposta:", err)
            return
        }

        fmt.Println("Status da resposta:", resp.Status)
        fmt.Println("Corpo da resposta:", string(responseBody))
    } else {
        fmt.Println("Erro na solicitação. Status da resposta:", resp.Status)
    }
}
LogoCapabilities and Integration Methods | Unico IDCloud - DevCenter
https://identityhomolog.acesso.io
https://identityhomolog.acesso.io/
http://identityhomolog.acesso.io
​
Help Center
​
Help Center
​
Help Center
here
https://api.cadastro.uat.unico.app
https://api.cadastro.unico.app
​
Help Center
​
Help Center
​
Help Center
SDKs
​
Help Center

Additional Resources

In this section you will find additional resources related to the integration medium by Unico

Here are the articles in this section:

Integration by Client

Nesta seção, você encontrará todas as especificações técnicas das APIs REST do IDCloud, utilizando o meio de integração by Client

Desktop

Webmobile

App mobile

GetDocumentSigned

In this section, you will find how to obtain the signed document of a process in by Unico through the REST API


Introduction


In this section, you will find detailed documentation on how the Signed Document Retrieval endpoint works in by Unico. This endpoint will provide the signed document of the end user in flows that have the Electronic Signature capability.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:


Obtaining the Signed Document


Exemplo de um documento gerado:

If the return of the signed document via by Unico is delayed in processing, we recommend waiting at least one minute after the process is completed before performing the query. Additionally, it is important to set up an automatic retry policy for cases where the signed document is not yet available, such as making up to 10 attempts with intervals of 1 to 5 minutes between them.

For more information about the possible errors for this endpoint, refer to the Errors section.


GetEvidenceSign

In this section, you will find how to obtain the signed document of a process in by Unico through the REST API


Introduction


In this section, you will find detailed documentation on how the Signed Document Proof Set Retrieval endpoint works in by Unico. This endpoint will provide the proof set of the end user's signature in flows that have the Electronic Signature capability.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

You can learn more about generating an access token here.

Endpoints:


Obtaining the Evidentiary Set of the Signed Document


Example of a generated document:

For more information about the possible errors for this endpoint, refer to the Errors section.


Specification of the evidential set

In this section, you will find all the specifications of the evidential set from by Unico


The evidential set is a .pdf document containing authentication evidence of a user who underwent identity validation at by Unico.

Below, you will see how this document is represented, as well as the specification of its return fields:

Evidence Set Fields (click on each to learn more)

User
  • Watermarked photo;

  • Name - indicates the name of the authenticated person. This data is obtained through the person.friendly_name parameter of CreateProcess;

  • CPF of the holder - indicates the CPF of the authenticated person. This data is obtained through the person.dui_value parameter of CreateProcess;

  • Contact channel - indicates the communication channel with the authenticated person. This data is obtained through the person.notifications parameter of CreateProcess.

Process
  • Executed flow – indicates which flow was executed. This data is obtained through the flow parameter of CreateProcess.

  • Process identifier – indicates the process ID. This data is obtained through the process.id parameter in the CreateProcess response.

  • URL – indicates the authentication URL of the process.

  • Creation – indicates the process creation date. This data is obtained through the createdAt parameter in the CreateProcess response.

  • Completion – indicates the process completion date. This data is obtained through the finishedAt parameter in the CreateProcess response.

  • State – indicates the process status. This data is obtained through the state parameter in the CreateProcess response.

  • Company – indicates the company.

Validations
  • Validation type - indicates the type of validation for the authentication process;

  • Identity - indicates the result of the Identity Verification;

  • Liveness detection - indicates the result of the Liveness Test.

Navegation data
  • Operating system and browser - indicates the device data;

  • IP address - indicates the device's IP address.

Evidence of module usage in the flows iddocs, idsign, and iddocssign

When the process involves the IDDocs and Sign flows, the probative set also returns data from these flows such as: Documents:

  • Document type - identifies the document shared by the person. Ex: CNH / RG;

  • Collection module - if Yes, identifies whether a document was captured;

  • Document validated - if Yes, indicates that the shared/reused document has been validated.

Signature:

  • Envelope data - indicates the documents and their signers;

  • Envelope ID - UUID that identifies the envelope in Unico Sign.

These evidences can be used to ensure the authenticity of the process.

The evidentiary set is only available for completed processes.


GetProcess

In this section, you will find how to obtain the result of a process in by Unico through the REST API


Introduction


In this section, you will find detailed documentation on how the Process Result Query endpoint works in by Unico.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:


Process Result


Processes must be created exclusively through backend-to-backend communication, due to our CORS policy, which prevents processes from being created through frontend-to-backend communication.

The content returned in the process.services.documents.doc.data parameter, referring to the OCR Extraction technology, can be consulted below:

If we are unable to extract a field from the document, it is not listed in the API return.

Tips:

  • To implement your business rules, always validate the response from the capabilities by checking the parameters in the following order:

    • state = PROCESS_STATE_FINISHED AND result = PROCESS_RESULT_OK;

      • THEN, you can proceed with decision-making by analyzing the authenticationInfo parameter.

      • If you receive state = PROCESS_STATE_FINISHED AND result = PROCESS_RESULT_ERROR, interpret this as an error in the biometric process and attempt the process again.

  • To improve the performance of your operation, you can use our Webhooks and only query the results of processes that are in the finalized statuses.

  • For more information about the possible errors for this endpoint, refer to the Errors section.


GetEvidenceSet

In this section, you will find instructions on how to obtain the evidential set from a process in by Unico via the REST API


Introduction


In this section, you will find detailed documentation on how the Get Evidence Set endpoint works in by Unico. This endpoint will provide the evidence set of the completed biometric transaction, allowing you to store it for possible future disputes by the end user.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:


Obtaining the Evidentiary Set


Processes must be created exclusively through backend-to-backend communication, due to our CORS policy, which prevents processes from being created through frontend-to-backend communication.

The evidentiary set is only available for completed processes.

For more information about the possible errors for this endpoint, refer to the Errors section.


GetSelfie

In this section, you will find instructions on how to obtain the selfie from a process in by Unico via the REST API


Introduction


In this section, you will find detailed documentation on how the Get User Selfie endpoint works in by Unico. This endpoint will provide the user's selfie, with a watermark, from completed processes, allowing you to use it as support in cases of disputes by the user.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:


Obtaining User Selfie


Processes must be created exclusively through backend-to-backend communication, due to our CORS policy, which prevents processes from being created through frontend-to-backend communication.

Important:

  • The permission to obtain the user's selfie will depend on Unico's internal evaluation. Understand with the person responsible for your project whether you will be able to consume this service;

  • It is only possible to get the selfie with the watermark.

For more information about the possible errors for this endpoint, refer to the Errors section.


Customizations

In this section, you'll find all the customizations available in by Unico.


by Unico's customization options allow you to tailor its interface to your company's visual identity and create a personalized user experience.

Available customizations:


Logo Customization


You can customize the logo displayed to users who access by Unico journeys. This customization reinforces the partnership between your company and Unico, indicating that the verification is performed by Unico at the request of the client or partner.

To request the inclusion of the logo, send the Unico team a URL where the logo is hosted in an online directory (i.e., the logo must be accessible via URL in the browser).

Base64 encoded URLs cannot be registered. (These URLs typically begin with "data:image/jpeg;base64,/9j/4AAQ...").

Recommendations:

  • Preferably send the logo in the icon logo format, due to its better readability in reduced sizes.

Rules:

  • Make sure the logo is square, respects the proportional grid and ensures that it is exported with at least 192x192 pixels.

  • Accepted formats: SVG, PNG and JPEG.

Unaccepted logo formats


Rules:

  • Prioritize the application of the logo on backgrounds that guarantee legibility.

  • Do not use logos that do not respect the square grid.

  • Avoid using low-resolution logos.

  • Do not apply the logo on transparent backgrounds.

Recommendations:

    • Use the hexadecimal of the colors to check the contrast scale. Example: Foreground ColorPicker: #000000, Background Color: #FFFFFF, Contrast Ratio: 21.00:1.

Customizing the color and shape of buttons


Customize the by Unico action buttons. Define the text color, background, and border radius of the button to reinforce your company's visual identity.

Recommendations:

  • Choose accessible colors: When customizing button colors in By Unico, opt for an accessible color scheme that ensures visibility for all users, including those with visual impairments.

  • Contrast ratios: Aim for a contrast ratio higher than 4.51:1 for the best results.

  • Example: #FFFFFF (text) on #000000 (background) results in a contrast ratio of 21.00:1.

Rounding the button corners


In addition to text and background colors, you can also define the button's corner rounding (border-radius) in pixels, according to the scale below:

Customization settings


To configure the visual identity of the client or partner for the button, share the following information with Unico's implementation team:

  • Hexadecimal code for the button background color.

    • Example: #000000.

  • Hexadecimal code for the button text color.

    • Example: #ffffff.

  • Button corner rounding (border-radius) in pixels.

    • Example: 10px.

Customization of the contextualization screen


The by Unico contextualization module allows the client or partner to provide information about the verification, such as the requesting company, reason, and value of the operation, making the process more secure.

The section of the request to be modified is as follows:


SDK

In this section, you will find how to implement the Unico SDK in your web application for using the by Unico


The use of integrations that do not comply with the standards outlined in this documentation may result in unexpected system interruptions, which will not be covered or supported by by Unico.

Examples: Embedding the by Unico SDK (iFrame) within a webview, implementing the iFrame using an HTML tag, etc.

How to start


To use by Unico through the Unico Web SDK, the first step is to register the domains, always using the HTTPS protocol, that will be used as hosts to display the user journey experience.

Please inform the person responsible for your integration project or the Unico support team to carry out this configuration.

To begin using the SDK, we should start with the installation of the Unico web SDK:. by Unico uses the same SDK that is used for IDPay:

When installing the Unico SDK package, deploy without specifying the version you are using so that your dependency manager always updates minors and patches to the latest version.

Available methods


1

init(options)

This method initializes the SDK by preloading assets, creating a smoother experience for the end user. At this point, it is necessary to send the token received as a result of the CreateProcess.

Parameters:

  • options - an object with the following configuration properties:

    • type

      • The type of flow to be initialized. In by Unico, we use the "IFRAME" option.

    • token

      • Receives the token of the created process. This token is important to authenticate the journey and ensure that only authorized domains can use it (can be obtained when creating the process via API).

2

open(options)

This method opens the by Unico experience. For the IFRAME flow, this function displays the already preloaded iFrame and initiates the messaging flow between the client page and the by Unico experience.

Parameters:

options - an object with configuration properties:

  • processId

    • Receives the ID of the created process. This ID is important to obtain the process details and carry out the entire flow correctly (can be obtained when creating the process via API).

  • token

    • Receives the token of the created process. This token is important to authenticate the journey and ensure that only authorized domains can use it (can be obtained when creating the process via API).

  • onFinish(process)

    • Receives a callback function that will be executed at the end of the by Unico journey, passing the process object with the following data: { captureConcluded, concluded, id }.

The sequence diagram below demonstrates how to use the SDK and the API result from by Unico to configure the iFrame:


Opt for the Iframe Solution with Auth Token Instead of CSP


After careful analysis of our needs and challenges, we have decided to adopt a solution based on iframes with authentication tokens rather than implementing a Content Security Policy (CSP). This choice was motivated by various considerations related to the security and flexibility required to meet our clients' demands.

Context and Challenges with CSP


Content Security Policy (CSP) is a powerful tool for protecting web applications against various types of attacks, such as Cross-Site Scripting (XSS) and code injection. However, when configuring a CSP policy, it is necessary to define a strict list of trusted domains. This approach is effective when the domains are fixed and predictable. However, for our clients, who often use dynamic and variable domains, this rigid configuration presents significant challenges.

Vulnerability with Dynamic Domains


Dynamic domains pose a substantial security risk when using CSP. When a client has domains that frequently change or are created dynamically, it would be necessary to constantly update the CSP policy to include these new domains. This not only increases maintenance efforts but also exposes the domains to which the CSP policy applies. Each domain added to the CSP policy is potentially a vulnerability point if not adequately managed.

Solution with Iframe and Auth Token


To mitigate these risks and meet the flexibility required by our clients, we opted to use iframes combined with authentication tokens. This solution provides an additional layer of security and avoids the need to expose or manage an extensive and dynamic list of domains.

How It Works


  • Secure Authentication: Each iframe is loaded with a unique authentication token for each transaction, ensuring that only authorized users can access the content. This token is verified in real-time, providing an additional layer of security and control.

  • Content Isolation: The use of iframes allows for the isolation of content in a separate context, reducing the risk of interference between different origins and mitigating potential attacks.

  • Flexibility for Dynamic Domains: By not relying on a static CSP policy, our solution easily adapts to our clients' dynamic domains without the need for constant updates to security policies.


Redirecting the user

In this section, you will find information on how to redirect a user in your applications within the by Unico experience


he userRedirectUrl field is used to direct the user. This field is received in the success response of the process creation when making the CreateProcess request.

Here you will find three ways to manage the user experience in web applications:

It is also possible to use the link generated by Unico in hybrid frameworks. To do this, you can create a bridge between the framework used and the native one and follow as we suggest in the documents or use a library that makes these integration options available.

Integrating WebView into your application is the customer's sole responsibility, as this functionality is not offered as part of Unico's libraries or SDKs. Because of this, we do not offer technical support for questions or problems related to implementing WebView in your application. For configuration guidance, we recommend consulting the official documentation for the technology used in your project (e.g. React Native, Flutter, etc.).


Errors

In this section, you will find an overview of the errors you may encounter in the endpoints of the Unico IDCloud platform.


Introduction


The IDCloud platform uses conventional HTTP response codes to indicate the success or failure of an API request.

As a general rule:

  • Codes in the 2xx range indicate a successful request;

  • Codes in the 4xx range indicate incorrect or incomplete parameters (for example, a required parameter was omitted, or an operation failed with third parties, etc.);

  • Codes in the 5xx range indicate that there was an error on the Unico IDCloud platform's servers.

The Unico IDCloud platform also generates an error message and an error code formatted in JSON:

Possible Errors


In this topic, you will find the possible errors for the endpoints, separated by their HTTP response.

Create Process


No detailed error code will be provided for this situation, only the HTTP status code.

Consult Process Result


No detailed error code will be provided for this situation, only the HTTP status code.

Get User's Selfie


No detailed error code will be provided for this situation, only the HTTP status code.

Obtain Evidence Set


No detailed error code will be provided for this situation, only the HTTP status code.

Obtain Signed Document


No detailed error code will be provided for this situation, only the HTTP status code.

Obtain Evidence Set of the Signed Document


No detailed error code will be provided for this situation, only the HTTP status code.

No detailed error code will be provided for this situation, only the HTTP status code.


Postman Collection

In this section, you will find the Postman collection with the REST APIs of by Unico



PoCs available

In this section, you will find a list of all the PoCs from Unico available to support your implementation.


The following project examples are provided to facilitate understanding of how Unico works.

If you do not find the PoC in this section, request it from your Project Manager, and it will be shared through an SFTP directory.

PoCs in a native environment

Our support is restricted to applications developed directly on the native Android and iOS platforms, using their respective native modules, as well as the Flutter framework (if the implementation uses our plugin). At this time, we do not offer support for applications developed with hybrid frameworks such as React Native, Ionic, or other cross-platform development technologies.

PoCs in a web environment


QR Code

In this section, you will find how the QR Code flow works for desktop experiences.


By Unico provides the QR code functionality to facilitate the flow on desktop devices. Through the QR code, it is possible to start the By Unico in a web experience without having to worry about whether the user's device has a camera or not. In this way:

  • We reduce the chance of failure in biometric capture;

  • We ensure a better experience in other capabilities;

  • We increase the chances of conversion.

Talk to the person responsible for your project to activate the feature.

How does it work?


When the user starts By Unico through a desktop device:

We identified that it's a desktop device and provided the QR code so the user can continue the journey on their mobile:

Once scanned, the user continues their journey on the mobile as usual, while the desktop device waits for the completion:

The desktop device detects that the journey was completed on the mobile and redirects the user to the originating experience:

Device qualification criteria as a desktop


  • Screen size: minimum width of 961px;

  • Screen orientation: landscape;

  • User-Agent: must not be a mobile device.


You can learn more about generating an access token .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Produção: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

To learn more about the evidence set, see the section.

You can learn more about generating an access token .

UAT: ;

Produção: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Produção: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Ex: .

Prioritize colors with a readable contrast of at least 4.5:1, following accessibility parameters.

Accessible colors improve navigation for everyone, especially for people with low vision. Use hexadecimal color codes to check contrast and follow guidelines.

To customize the information on the contextualization screen, change the values of the parameters contained in the contextualization object when making the call.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

To check previous versions, go to .

Security

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

(1) Using Redirect:

It is recommended to follow these steps:

  • In your common flow (which includes the by Unico Registration), you will redirect the client to the link generated through the API;

  • After that, the client within the platform carries out the necessary procedures to continue the flow;

  • When completed, they are redirected to your page (using the redirectUrl provided during the process creation).

(2) Using window.open():

The window.open() option consists of opening a new tab in the user's browser so that they can complete the process. At the end, this tab is closed and redirected to your application.

For this, it is recommended to:

  • Follow the public documentation on this, which can be found ;

  • Monitorar se houve alteração de URL (para a redirectUrl) e então fechar a aba utilizando window.close().

Step 1: Using CustomTabs for Integration

1 - Add the necessary dependency for using CustomTabs in your app/build.gradle:

Step 2: Opening a CustomTab

Step 3: Modifying AndroidManifest

Add the necessary permissions and intents in the AndroidManifest.xml for the Activity that you want to receive the callback_uri. It is necessary to include the attribute android:launchMode="singleTop" as well as the <data> tag providing the URI data.

The following permissions are necessary for it to function correctly:

  • Camera

  • Geolocation

Step 4: Getting Return Information

o retrieve redirect information with the provided data, you can use the following code in the onNewIntent method of your Activity:

Passo 1: Criar o controlador de autenticação

1 - O primeiro passo é criar o controlador de autenticação, e, para isso crie uma classe chamada UnicoAuthenticationController (ou como preferir chamar).

2 - Na sequência, importe o framework AuthenticationServices no topo da classe.

3 - Declare a classe como NSObject e implemente o protocolo ASWebAuthenticationPresentationContextProviding.

  • O resultado deve ser:

Passo 2: Implementar a autenticação

1 - Abra o arquivo onde você executa a autenticação e adicione as importações necessárias (como exemplo, o ContentView.swift é usado).

2 - Para controlar o estado do fluxo é preciso criar a propriedade @State.

3 - Crie uma instância da classe UnicoAuthenticationController fora do corpo da estrutura ContentView.

4 - Para a validação do processo, crie uma função chamada redirectUser.

Ambientes:

Lembre-se de alterar a url URL_AUTHENTICATION para a URL de autenticação recebida em seu processo e também o callbackURLScheme BUNDLE para o redirect informado na criação do processo (o uso do Bundle Identifier de seu aplicativo é recomendado).

Autenticação única:

É importante setar prefersEphemeralWebBrowserSession para true para garantir uma autenticação única por processo.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

code
message
description
message
description
code
message
description
code
message
description
message
description
code
message
description
code
message
description
code
message
description
message
description
code
message
description
code
message
description
code
message
description
code
message
description
message
description
code
message
description
code
message
description
code
message
description
code
message
description
code
message
description
code
message
description
code
message
description

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Programming Language
Description
Repository
Programming Language
Description
Repository

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

here
https://signhom.acesso.io
https://sign.acesso.io
​
Help Center
https://signhom.acesso.io
https://sign.acesso.io
​
Help Center
"contextualization": {
    "currency": "BRL",
    "price": "<FLOAT_NUMBER>",
    "locale": {
      "ptBr": {
        "reason": "<REASON_PTBR>"
      },
      "enUs": {
        "reason": "<REASON_ENUS>"
      },
      "esMX": {
        "reason": "<REASON_ESMX>"
      }
$ npm install idpay-b2b-sdk
import { UnicoSDK } from “idpay-b2b-sdk”;

UnicoSDK.init({
  type: 'IFRAME',
  env: 'uat'//only if the environment is uat
  token,
});
const processId = '9bc22bac-1e64-49a5-94d6-9e4f8ec9a1bf';
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';

const process = {
  id: '9bc22bac-1e64-49a5-94d6-9e4f8ec9a1bf',
  concluded: true,
  captureConcluded: true
};

const onFinishCallback = process => {
  console.log('Process', process);
}

UnicoSDK.open({
  transactionId: processId,
  token: token,
  onFinish: onFinishCallback
});
xml
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-permission android:name="android.permission.CAMERA"/> 
// ermissions for camera and geolocation are required

<activity
    android:name=".CustomTabActivity"
    android:exported="true"
    android:label="@string/app_name"
    android:theme="@style/Theme.Customtabs"
    android:launchMode="singleTop">

    <intent-filter android:label="Custom Tab">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <!-- scheme e host são os dados fornecidos na criação de um processo no campo callback_uri
        callback_uri: "foobar://success?code=1234" -->
        <data android:scheme="foobar" android:host="success"/>
    </intent-filter>

</activity>
override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)

    val url = intent.data
    val scheme = url.scheme // "foobar"
    val host = url.host // "success"
    val code = url.getQueryParameter("code") // "1234"
}
import AuthenticationServices

class UnicoAuthenticationController: NSObject, ASWebAuthenticationPresentationContextProviding {
    func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
           if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
               if let mainWindow = windowScene.windows.first {
                   return mainWindow
               }
           }
           return ASPresentationAnchor()
       }
}
import SwiftUI
import AuthenticationServices
@State private var finished = false
let unicoController = UnicoAuthenticationController()
func redirectUser() {
        guard let url = URL(string: "URL_AUTHENTICATION") else { return }

        var session: ASWebAuthenticationSession?
        session = ASWebAuthenticationSession(url: url, callbackURLScheme: "BUNDLE") { callbackURL, error in
            guard callbackURL != nil else {
                if let error = error {
                    return print("Erro durante o processo: \(error.localizedDescription)")
                }
                return
            }

            // Processa o URL de callback para verificar se o processo foi finalizado
            session?.cancel()
            finished = true
        }

        session?.presentationContextProvider = unicoController
        session?.prefersEphemeralWebBrowserSession = true
        session?.start()
    }
{
    "error": {
        "code": "0000",
        "description": "error description"
    }
}

3

invalid flow

When the specified flow does not exist.

3

invalid purpose

When the provided proposal is invalid.

3

invalid callbackUri: unable to parse callbackUri: parse "": empty url, invalid callbackUri: url:

When the provided callbackUri is invalid.

3

invalid person: email required for notification channel NOTIFICATION_CHANNEL_EMAIL, invalid email address for notification channel NOTIFICATION_CHANNEL_EMAIL

When the provided email is invalid, but there is email notification.

3

invalid person: phone number required for notification channel NOTIFICATION_CHANNEL_WHATSAPP, phone number does not contain 13 chars for notification channel NOTIFICATION_CHANNEL_WHATSAPP

When the provided phone number is invalid, but there is notification via SMS or WhatsApp.

3

idnsv2/GetPublicID request error: rpc error: code = InvalidArgument desc = invalid dui value

When the provided CPF is invalid.

9

XX ID Apikeys are not set

When an API Key has not been configured correctly.

Jwt header is an invalid JSON

When the access token used contains incorrect characters.

Jwt is expired

When the access token used has expired.

99999

Internal failure! Try again later

When there is an internal error.

3

process id is invalid

When the process ID is invalid.

Jwt header is an invalid JSON

When the access token used contains incorrect characters.

Jwt is expired

When the access token used has expired.

5

error getting process: rpc error: code = NotFound desc = process not found

When the process ID was not found.

99999

Internal failure! Try again later

When there is an internal error.

3

process id is invalid

When the process ID is invalid.

Jwt header is an invalid JSON

When the access token used contains incorrect characters.

Jwt is expired

When the access token used has expired.

7

no permission

When the service account does not have permission to retrieve the selfie.

5

error getting process: rpc error: code = NotFound desc = process not found

When the process ID was not found.

99999

Internal failure! Try again later

When there is an internal error.

3

process id is invalid

When the process ID is invalid.

Jwt header is an invalid JSON

When the access token used contains incorrect characters.

Jwt is expired

When the access token used has expired.

7

no permission

When the service account does not have permission to retrieve the selfie.

5

error getting process: rpc error: code = NotFound desc = process not found

When the process ID was not found.

99999

Internal failure! Try again later

When there is an internal error.

5

error getting process: rpc error: code = NotFound desc = process not found

When the process ID was not found.

99999

Internal failure! Try again later

When there is an internal error.

5

error getting process: rpc error: code = NotFound desc = process not found

When the process ID was not found.

99999

Internal failure! Try again later

When there is an internal error.

Usage and Integration Guide

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Android applications

​
Help Center
here
https://api.cadastro.uat.unico.app
https://api.cadastro.unico.app
​
Help Center
Evidence Set Specification
here
https://api.cadastro.uat.unico.app
https://api.cadastro.unico.app
​
Help Center
here
https://api.cadastro.uat.unico.app
https://api.cadastro.unico.app
​
Help Center
https://storage.googleapis.com/portal-orca-unico-prod/apps/orca/logo-default.png
WCAG
WCAG
CreateProcess
​
Help Center
https://www.npmjs.com/package/idpay-b2b-sdk?activeTab=versions
​
​
Help Center
implementation("androidx.browser:browser:1.5.0")
import android.net.Uri
import androidx.activity.ComponentActivity
import androidx.browser.customtabs.CustomTabsClient
import androidx.browser.customtabs.CustomTabsIntent

class CustomTabActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
       super.onCreate(savedInstanceState)

       openCustomTab(<URL_CBU>)
    }

    fun openCustomTab(url: String) {
        val builder = CustomTabsIntent.Builder()
        val customTabsIntent = builder.build()
        customTabsIntent.launchUrl(this, Uri.parse(url))
    }
}
here
​
Help Center
​
Help Center
​
Help Center
​
Help Center
​
Help Center

Usage and Integration Guide

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your iOS applications

Swift

PoC in Swift that implements Unico in the WebView on iOS

Kotlin

PoC in Kotlin that implements Unico in the WebView on Android

Angular

PoC in Angular that implements Unico through the Unico SDK

React

PoC in React that implements Unico through the Unico SDK

JavaScript

PoC in JavaScript that implements Unico through the Unico SDK

Vue JS

PoC in Vue.js that implements Unico through the Unico SDK

Overview

In this section, you will find all the technical specifications for By Client REST APIs


Introduction


by Client is a channel that offers complete freedom for the client to use the identity validation solutions from the IDCloud platform.

You can combine capabilities as you wish and for the most distinct use cases, but to do so, you will need to have API Keys configured with the capabilities you wish to use.

*It is also possible to use the by Client feature to process your face database. To do so, please contact your account manager, who will guide you through the necessary procedures for this process.

To request the capabilities in the API Key, contact the person responsible for your integration project or the Unico support team to make this configuration.

Synchronous and Asynchronous Capabilities


In by Client, we have capabilities where the response is synchronous (i.e., the response is returned when the process is created) and other capabilities that are asynchronous (where we process the data and you need to "fetch" the result through a GET method in the REST API).

In your operation, you can combine the capabilities as you wish, but each capability will have its own communication method. For example:

  • You can have an operation that uses the Identity Verification + Behavioral Alert + Risk Score capabilities;

  • When creating the process, the response for the Identity Verification and Behavioral Alert capabilities will be synchronous, provided in the response of the process creation API;

  • However, the Risk Score capability will be executed asynchronously, requiring you to wait for its processing and then make another GET request to obtain the final result of the process.

Below, see the synchronous and asynchronous capabilities:

Synchronous Capabilities


Liveness:

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 1
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 2
}

Identity verification:

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  }
}

Behavior Alert:

{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "identityFraudsters": {
    "result": "yes"
  }
}
{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "identityFraudsters": {
    "result": "inconclusive"
}

Validation (1:1)

{
    "authenticated": "true"
}
{
    "authenticated": "false"
}

Document Capture and Reuse:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": 3,
  },
  "document": {
    "id": "b97c3fd9-d95d-413f-bc0a-75eb87304421",
    "type": "CNH",
    "cpfMatch": false,
    "content": {
      "numero": "044589731564",
      "rgNumero": "123456789 SESP PR",
      "nomeCivil": "Homer Simpson",
      "filiacao": [
        "Monasimpson",
        "Monasimpson"
      ],
      "dataNascimento": "1990-05-12T00:00:00Z",
      "dataHabilitacao": "1997-11-18T00:00:00Z",
      "dataExpiracao": "2017-12-07T00:00:00Z",
      "dataEmissao": "2012-12-07T00:00:00Z",
      "localEmissao": "Curitiba PR",
      "categoria": "B",
      "renachNumero": "PR904987581"
    },
    "fileUrls": [
            "https://url-signer-1",
            "https://url-signer-2"
        ]
  }
}

Asynchronous Capabilities


Identity verification:

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  }
}

Just like the Identity Verification capability is a "synchronous" capability, it can also be configured for "asynchronous" use.

Risk scoring:

{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "score": 50
}

Behavior Alert:

{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "identityFraudsters": {
    "result": "yes"
  },
  "faceWithOtherId": {
    "result":"yes"
  }
}
{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "identityFraudsters": {
    "result": "inconclusive"
}

Just like the Behavior Alert capability is a "synchronous" capability, it can also be configured for "asynchronous" use.


Document Capture and Reuse

In this section, you will find the specific details on creating a process that includes Document Capture and Reuse as a capability


Introduction


In this section, you will find detailed documentation about the functionality of the endpoints related to the Document Capture and Reuse capability. The use of Reuse requires that there be a previous Identity Verification process and this must obtain a “YES” response OR the Risk Score equal or more than +50, otherwise it will be necessary to capture the user's document.

This is an synchronous capability that requires consuming two endpoints, detailed in this documentation, for its full utilization.

The capabilities of the Unico IDCloud platform via Client are managed through API Keys—used as a parameter in the request headers—that define the access scope. As a prerequisite, it is necessary to have an API Key configured exclusively for the Document Capture and Reuse capability, ensuring dedicated and secure access to the resource.

Talk to your project manager to obtain the API Key with this configuration.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:

GetReusableDocuments


If you find a document to be reused, in the process creation endpoint you will enter the ID of this document in the document.documentId parameter and it will not be necessary to capture the document and send the base64 in the document.files parameter.

CreateProcess


Important:

  • To use the Document Capture and Reuse capability, the Identity Verification capability must be used beforehand, as it is necessary to include the processId obtained from the Identity Verification in the document.authProcessId parameter:

    • The process must have valid biometrics, be used within 24 hours of completion and cannot be reused;

    • It is possible to reuse a biometric authentication previously performed by the same user within a period of up to 24 hours. Within this timeframe, the ID authentication proof can be used in different document verification processes (e.g., RG and CNH) without the need for a new biometric authentication.

  • If we are unable to extract a field from the document, it is not listed in the API return;

  • When using the Document Capture and Reuse feature, it is mandatory to inform the user, on the interface, about the reuse, as required by the contract.

  • If an error occurs during processing, the process will return a status = 5, as shown in the example below:

      {
      "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
      "status": 5
      }

Content returned in document.content based on document.type:

Tips:

  • When implementing your business rules, always validate the final statuses of the processes (3, 5). To validate the response of IDCloud capabilities, only consider status = 3 for your decision-making process;

  • For more information about possible errors for this endpoint, refer to the Errors section.


Liveness + Identity Verification + Behavior Alert

In this section, you will find the specifics of creating a process that has Liveness + Identity Verification + Behavior Alert as a capabilities


Introduction


IIn this section, you will find detailed documentation on how the endpoints related to the Liveness + Identity Verification + Behavior Alert capabilities work when used together.

These are three synchronous capabilities (Liveness + Identity Verification + Behavior Alert), meaning that the entire integration occurs using a single endpoint.

The capabilities of the Unico IDCloud platform via by Client are managed through API Keys - used as a parameter in the request headers - which define the access scope. As a prerequisite, you must have an API Key configured with the Liveness + Identity Verification + Behavior Alert capabilities, ensuring dedicated and secure access to the resource.

Talk to your project manager to obtain the API Key with this configuration.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:

CreateProcess


Important:

  • If the response for the Identity Verification capability returns unicoId = yes, this result already includes Liveness (i.e., the liveness parameter will not be included in the response);

  • The Identity Verification and Behavior Alert capabilities are completely independent. To implement your business rules, make sure to analyze what each return means.

  • To use the Liveness capability, it is mandatory to use our SDKs;

    • It is possible to use the Identity Verification capability without Liveness. For this use case, the liveness value will always return as liveness = 1. In this scenario, no Liveness validation is performed, not even passive validation.

  • If an error occurs during processing, the process will return a status = 5, as shown in the example below:

      {
      "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
      "status": 5
      }

Tips:

  • For this use case, there is no need to Query the Process Result, as the response is synchronous.

  • To implement your business rules, always validate the final statuses of the processes (3, 5). To validate the response from the IDCloud capabilities, only consider the status = 3 for your decision-making.

  • For more information on the scenarios you might receive in the response, refer to the Response Scenarios section.

  • For more information on possible errors for this endpoint, refer to the Errors section.


Response Scenarios

In this section, you will find the possible responses for the combinations of capabilities separated by their methods to facilitate your understanding of the by Client integration


Understanding how the return of each parameter works is essential for implementing the best decision-making. To see in detail the meaning of each parameter, see the section Parameter Specification

In all the combinations described below, if an error occurs during processing, the process will return a status = 5. For this reason, the scenarios below do not display responses related to this condition. Example:

  {
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 5 //indicates that there was an error in the process
  }

Liveness


For the scenarios where the response in CreateProcess is the same as the response from GetProcess, optimize your application and make your decision synchronously.

Liveness + Identity Verification


For the scenarios where the response in CreateProcess is the same as the response from GetProcess, optimize your application and make your decision synchronously.

Liveness + Identity Verification + Risk Score


For the scenarios where the response in CreateProcess is the same as the responsefrom GetProcess, optimize your application and make your decision synchronously.


Postman Collection

In this section, you will find the Postman collection for the by Client REST APIs



Liveness + Validation (1:1) + Behavior Alert

In this section, you will find the specifics of creating a process that includes Liveness + 1:1 Validation + Behavior Alert as capabilities.


Introduction


In this section, you will find detailed documentation on the operation of the endpoint related to the capabilities Liveness + 1:1 Validation + Behavior Alert, used together.

These are three synchronous capabilities, meaning the entire integration takes place using a single endpoint.

The capabilities of the Unico IDCloud platform via by Client are managed through API Keys - used as a parameter in the request header - which define the scope of access. As a prerequisite, it is necessary to have an API Key configured with the Liveness + 1:1 Validation + Behavior Alert capabilities, ensuring dedicated and secure access to the resource.

Talk to your project manager to obtain the API Key with this configuration.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:

CreateProcess


Important:

  • To use the liveness capability, it is essential to use our SDKs:

    • It is possible to use the Validation (1:1) capability without liveness. In this use case, we will not return the liveness parameter in the API response. In this scenario, there is no validation of the liveness, not even passive.

  • If an error occurs during processing, the process will return a status = 5, as shown in the example below:

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 5
  }

Tips:

  • For this use case, there is no need to Query the Process Result, as the response is synchronous;

  • For more information about possible errors for this endpoint, refer to the Errors section.


Capture standard (without SDK)

In this section, you will find how the capture standard for the user's selfie should be if you do not use our SDKs


For optimal performance of the IDCloud platform's capabilities, we recommend using our SDKs. They will ensure the best functioning of the product as a whole, both in terms of drop rate and in validating the Liveness.

To achieve better results in image capture, a capture standard has been defined. The image should be clear with sufficient frontal lighting. The face should be straight, facing the camera, free from objects or obstructions, and with a neutral expression.

Common issues in captured images include:

  • Lighting behind the client: Frontal lighting must be strong enough for a clear capture of the face.

  • Overexposed lighting: Frontal lighting needs to be adequate for a sharp capture.

  • Face too close to the camera: The face should be centered in the camera frame with proper lighting.

  • Blurry images: The person’s face needs to be well-focused at the moment of capture.

  • Shaky images: Stabilize the camera during capture.

  • Client wearing glasses: The client should not wear glasses or objects that obstruct full visibility of the face.

How to Obtain a Good Image Capture


For obtaining and sending images, the ICAO standard is used. The ICAO (International Civil Aviation Organization) standard defines characteristics for a photograph to comply with the following requirements and recommendations for image capture and submission settings:

  • Face Positioning and Additional Information:

    • The photo should be taken from the front — look directly at the camera and keep the head upright. The face should be centered. The shoulders should be aligned and parallel to the camera's image plane.

    • The eyes should be naturally open — pupils and irises visible.

    • Glasses — the photo should be captured without glasses.

    • No hats, caps, or masks — the face area should be clearly visible.

    • Neutral expression — the face should have a neutral expression, the person should not smile, raise eyebrows, squint, or frown.

    • Hairstyle — Hair should not cover the visible eye area.

  • Lighting and Background: The background should be light, smooth, and without texture. It should not contain spots, lines, or curves visible in the captured image. Light colors like light blue or white can be used as long as there is sufficient contrast between the face/hair and the background. Camera color settings should not be altered depending on the background color. There should be no shadows behind the face image. Additionally, no visible objects should be present in the background, such as people, furniture, patterned wallpapers, or plants. The lighting should be adequate and uniform, equally distributed across the face so there is no difference between the left and right sides. The photo should have good brightness and contrast between the hair, face, and background. Poor lighting occurs when light is only from the side, top, or bottom.

  • Image formats: JPEG, PNG, or JWT.

  • Images should be captured in color.

Sizes/Proportions


Selfies:

  • Recommended size: Aspect ratio 1920x1080 or 1080x1920;

  • Orientation: Portrait;

  • Size: Maximum 800kb, if necessary you can compress it to Jpeg92.

Documents:

  • Recommended Size: HD ratio - 1280x720 or 720x1280;

  • Minimum Size: VGA ratio - 640x480 or 480x640;

  • Orientation: If OCR is used, it is recommended that the image be captured in reading orientation;

  • Size: Maximum 800KB. If necessary, you can compress to Jpeg92;

  • Framing: It is recommended that the image has no unnecessary space (no borders). The larger the unused area (border), the worse it will be for document classification.

Examples of Standard and Non-Standard Photos:


The photo must include:

  • Color

  • Proper framing

  • Sharp and clear focus, free of ink marks or creases.

  • Look directly at the camera.

  • Show the natural skin tone.

  • Have appropriate brightness and contrast.

  • Neutral expression and eyes clearly visible.

  • No hair covering the eyes.

  • Facing the camera directly, without looking over the shoulder or tilted, and showing both edges of the face clearly.

  • With a simple light-colored background, preferably white.

  • With even lighting, no shadows or flash reflections on the face, and without red-eye.

  • No colored contact lenses.

  • No makeup.

The use of glasses is not recommended; however, if necessary:

  • The eyes must be clear, without reflections from flash or ambient light on the glasses, and without colored lenses.

  • The frame must not cover any part of the eyes.

Tips


Add instructions before capturing for the user:

Use capture "frames" to guide the client's positioning in front of the camera:


Liveness + Identity Verification + Behavior Alert + Risk Score

In this section, you will find the specifics of creating a process that has Liveness + Identity Verification + Behavior Alert + Risk Score as a capabilities.


Introduction


In this section, you will find detailed documentation on how the endpoints related to the Liveness + Identity Verification + Behavior Alert capabilities work when used together.

These are three synchronous capabilities (Liveness + Identity Verification + Behavior Alert), meaning that the entire integration occurs using a single endpoint.

The capabilities of the Unico IDCloud platform via by Client are managed through API Keys - used as a parameter in the request headers - which define the access scope. As a prerequisite, you must have an API Key configured with the Liveness + Identity Verification + Behavior Alert capabilities, ensuring dedicated and secure access to the resource.

Talk to your project manager to obtain the API Key with this configuration.

Getting started


Your API requests are authenticated using an access token. Any request that does not include a valid access token will return an error.

Endpoints:

CreateProcess


Important:

  • If the response from the Identity Verification capability is unicoId = yes, this response already includes the Liveness (meaning you will not receive the liveness parameter in the response).

  • The Identity Verification and Behavior Alert capabilities are completely independent. To implement your business rules, make sure to analyze what each return means.

  • To use the Liveness capability, it is essential to use our SDKs:

    • It is possible to use the Identity Verification capability without Liveness. In this use case, the liveness return will always be liveness = 1. In this scenario, there is no validation of the life proof, not even passive validation.

  • If an error occurs during processing, the process will return a status = 5, as shown in the example below:

  •   {
      "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
      "status": 5
      }

Tips:

  • For this use case, there is no need to Query the Process Result, as the response is synchronous.

  • To implement your business rules, always validate the final statuses of the processes (3, 5). To validate the response from the IDCloud capabilities, only consider status = 3 for your decision-making.

  • For more information on the scenarios you might receive in the response, refer to the Response Scenarios section.

  • For more information on possible errors for this endpoint, refer to the Errors section.

GetProcess


In the v2 endpoint (/processes/v2/{id}), we also return additional user information, as shown in the example below:

"processAdditionalInfo": {
      "transactionId": "2ed76ac5-8fd7-4477-839d-92bedd7e9fd5",
      "personName": "Nome da pessoa",
      "personDocument": "Número do documento da pessoa",
      "personImage": "URL assinada da imagem da pessoa",
      "finishedAt": "2024-10-04T18:53:17.028228"
  }
}

Attention:

  • When making a GET request for a process with status = 5 (error), the return status code will be 410 (Gone) instead of 200 (Success);

  • There may be cases of drops during orchestration with the Risk Score capability. In this scenario, the process will have the following combination: {status = 3, unicoId = inconclusive, liveness = 1, and NO score in the API response}. Learn more in the Response Scenarios section;

  • If you query a process with status = 2, implement polling until you receive status = 3 or implement Unico's Webhook to know when to get the result.

  • When implementing your business rules, always validate the final statuses of the processes (3, 4, 5). To validate the response of IDCloud capabilities, only consider status = 3 for your decision-making process;

  • To improve the performance of your operation, you can use our Webhooks and only query the results of processes that have a finalized status;

  • For more details on the scenarios you might receive in the response, refer to the Response Scenarios section;

  • For more information about possible errors for this endpoint, refer to the Errors section.


Installation Guide

In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your Android applications


Development Environment Preconditions


Your development environment must meet the following prerequisites:

  • Have the Android SDK version 21 or higher;

  • Have the Unico Maven repository configured.

The capture component provided through the Android SDK supports versions equal to or higher for the following technologies:

  • Android: 5.0 (API 21);

  • Kotlin: 1.6.

Compatible Devices


This SDK does not work on emulators, only on physical devices.

The Android SDK is compatible with the majority of devices running Android 5.0 (API level 21) or higher.

The table below lists the devices tested in the lab, along with the availability of the supplier/manufacturer extensions. Some extensions listed may be subject to specific APIs or SKUs from the manufacturer. Click below to view the tested devices:

ASUS - X01BDA

10.0.0

Físico

ASUS - Z01KD

8.0.1

Físico

HUAWEY - P30 Lite

9.0.0

Físico

LG - K22

10.0.0

Físico

LG - Q6

7.0.0

Físico

MOTOROLA - Moto one macro

10.0.0

Físico

MOTOROLA - Moto G4

6.0.1

Físico

MOTOROLA - Moto G5s Plus

8.1.0

Físico

MOTOROLA - Moto G6 Play

9.0.0

Físico

MOTOROLA - Moto G7 Play

10.0.0

Físico

MOTOROLA - Moto G7 Power

10.0.0

Físico

MOTOROLA - Moto G8 Power Lite

10.0.0

Físico

SAMSUNG - A01

10.0.0

Físico

SAMSUNG - J8 SM J810M

8.1.0

Físico

SAMSUNG - Galaxy A30s SM-A307GT

10.0.0

Físico

SAMSUNG - Galaxy A51

10.0.0

Físico

SAMSUNG - Galaxy A71

11.0.0

Físico

SAMSUNG - Galaxy S20+

11.0.0

Físico

SAMSUNG - s10e

11.0.0

Físico

XIAOMI - Mi 8 Lite

9.0.0

Físico

XIAOMI - Mi 8 Lite

10.0.0

Físico

XIAOMI - Poco X3

10.0.0

Físico

XIAOMI - Redmi Note 8

10.0.0

Físico

XIAOMI - Redmi Note 8 Pro

10.0.0

Físico

XIAOMI - Redmi Note 9

10.0.0

Físico

XIAOMI - Redmi Note 9 Pro

10.0.0

Físico

GOOGLE - Pixel sailfish

8.0.0

Virtual (TestLab)

HUAWEY - ALE L23

5.0.0

Virtual (TestLab)

HUAWEY - ANE LX1

9.0.0

Virtual (TestLab)

HUAWEY - ANE LX2

9.0.0

Virtual (TestLab)

HUAWEY - COR L29

8.1.0

Virtual (TestLab)

HUAWEY - MHA L29

7.0.0

Virtual (TestLab)

HUAWEY - NEO L29

9.0.0

Virtual (TestLab)

SAMSUNG - SC 02J

8.0.0

Virtual (TestLab)

SAMSUNG - SM G891A

9.0.0

Virtual (TestLab)

SAMSUNG - SM G930AZ

8.0.0

Virtual (TestLab)

SAMSUNG - SM G935A

8.0.0

Virtual (TestLab)

SAMSUNG - SM G965N

9.0.0

Virtual (TestLab)

SAMSUNG - SM G965U1

8.0.0

Virtual (TestLab)

SAMSUNG - SM G981U1

10.0.0

Virtual (TestLab)

SAMSUNG - SM J727V

8.1.0

Virtual (TestLab)

SAMSUNG - SM N950F

9.0.0

Virtual (TestLab)

SAMSUNG - SM N950N

9.0.0

Virtual (TestLab)

SAMSUNG - SM N950U

8.0.0

Virtual (TestLab)

SAMSUNG - SM N960F

9.0.0

Virtual (TestLab)

SAMSUNG - SM N960N

9.0.0

Virtual (TestLab)

SAMSUNG - SM N960U1

8.1.0

stLab)

Installing the Android SDK


To implement the Unico IDCloud Android SDK into your Android application, follow the step-by-step instructions listed below:

1

Configuring the Maven Repository

The Android SDK is provided through a Maven Repository. Add the following to the repositories block in the build.gradle file located at the root of your project:

/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects 
{
    repositories {
        google()
        maven { 
            url "https://maven-sdk.unico.run/sdk-mobile" 
        }
    }
}

Enable AndroidX support in your gradle.properties file at the root of your project (this ensures better performance and operation of the capture framework):

gradle.properties
# Project-wide Gradle settings.
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

2

Camera and Internet Permissions

To use the camera and internet opening method in your project, you need to add the permissions in your file AndroidManifest.xml:

AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

3

Adding the Dependency

After configuring the Android SDK, simply import it into your project. To do this, add acessobio-android to the dependencies block in the app/build.gradle file.

  • The dependency should be included in a file different from the one used in the previous step. In this step, you need to use the build.gradle file for the module, not the project.

app/build.gradle
/* unico */
implementation 'io.unico:capture:$version'

When compiling the project, you may encounter the following error:

  • Invoke-customs are only supported starting with android --min-api 26

This is due to the incompatibility with the min-26 frame version. Add the following lines to the compileOptions block in the same app/build.gradle file:

android { 
    compileOptions { 
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8 
      } 
}

4

Obtaining Credentials

  • Contact the CS and/or Onboarding team.

  • Request the SDK Key by providing the identifiers of your applications: Bundle Identifier for iOS, PackageID for Android, and Host for WEB.

  • The identifiers of your applications will be linked to the SDK Key by the Unico team.

  • You will receive your SDK Key to implement the AcessoBioConfigDataSource.

5

Embedding Credentials in Your Project

  • Implement the AcessoBioConfigDataSource protocol in your class:

package <package_name>

import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource;

public class UnicoConfig implements AcessoBioConfigDataSource {
    @Override
    public String getBundleIdentifier() {
        return BUNDLE_IDENTIFIER;
    }
        
    @Override
    public String getHostKey() {
        return SDK_KEY;
    }
}
package <package_name>

import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource

class UnicoConfig : AcessoBioConfigDataSource {
    override fun getBundleIdentifier(): String {
        return BUNDLE_IDENTIFIER
    }

    override fun getHostKey(): String {
        return SDK_KEY
    }
}
Depracated Method - Java
package <package_name>

import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource;

public class UnicoConfig implements AcessoBioConfigDataSource {
    @Override
    public String getProjectNumber() {
        return PROJECT_NUMBER;
    }
    
    @Override
    public String getProjectId() {
        return PROJECT_ID;
    }
    
    @Override
    public String getMobileSdkAppId() {
        return MOBILE_SDK_APP_ID;
    }
    
    @Override
    public String getBundleIdentifier() {
        return BUNDLE_IDENTIFIER;
    }
    
    @Override
    public String getHostInfo() {
        return HOST_INFO;
    }
    
    @Override
    public String getHostKey() {
        return HOST_KEY;
    }
}
Deprecated Method - Kotlin
package <package_name>

import com.acesso.acessobio_android.onboarding.AcessoBioConfigDataSource

class UnicoConfig : AcessoBioConfigDataSource {
    override fun getProjectNumber(): String {
        return PROJECT_NUMBER
    }

    override fun getProjectId(): String {
        return PROJECT_ID
    }

    override fun getMobileSdkAppId(): String {
        return MOBILE_SDK_APP_ID
    }

    override fun getBundleIdentifier(): String {
        return BUNDLE_IDENTIFIER
    }

    override fun getHostInfo(): String {
        return HOST_INFO
    }

    override fun getHostKey(): String {
        return HOST_KEY
    }
}


Update Policy

In this section, you will find the update policy for using the SDK


It is essential that all clients maintain a regular SDK update routine, as new forms of attacks are developed constantly. The best way to protect your business against new types of Injection and Liveness fraud is to use the most up-to-date version of the Unico SDK.

It is the client's responsibility to maintain a healthy SDK update routine, ensuring the minimum version for the proper functioning of our solutions in their operations. Similarly, it is Unico's responsibility to provide updated versions in response to emerging threats in the market and to keep our clients informed on the topic. With this in mind, Unico has created an SDK Update Policy.

Why do we have an SDK update policy?


With the SDK outdated, our clients are vulnerable to attacks from fraudsters. Given that Unico prioritizes the utmost security for its clients, along with the urgency of the matter and the need for an agile update process, the SDK Update Policy was created to safeguard our clients from the latest frauds that constantly emerge in the market. The only way to be secure is to stay updated.

Categories of Updates


Unico categorizes all SDK updates into Critical and Non-Critical, based on the severity of the frauds that are blocked with the new version.

  • Critical Updates: These updates are designed to protect our clients against recent frauds and attacks in the market. They must be implemented within 5 (five) calendar days due to the real threat that the operation is susceptible to. After this period, we will no longer provide support for previous versions. In practice, any client who contacts us with a version earlier than the latest will be required to update the SDK in order for us to assist them.

  • Non-Critical Updates: These updates are simpler, focusing on technological improvements. They can be implemented within 60 (sixty) calendar days. It is important to note that the more up-to-date the version, the higher the chances of avoiding bugs and errors. Therefore, we recommend updating as soon as possible. After this period, we will no longer provide technical support, and the client must update their SDK in order for us to assist in cases.

We identify critical updates in the Release Notes with a tag just below the version, as shown in the example below:

Critical Update

These periods apply to all Unico clients, regardless of the capacity used.



Where can I see what’s new in the versions?


How do I know when a new version is released?


  • For Critical updates: We will send an email as soon as the new version is available, with reinforcement from the Customer Success team, highlighting the urgency of the matter and the 5 (five) calendar days deadline for the update.

  • For Non-Critical updates: To avoid overloading the client teams, we will send a monthly email with a summary of the non-critical updates, informing the key changes and the 60 (sixty) calendar days deadline for the update.


Overview

In this section, you will find an overview of how the Unico IDCloud platform SDK operates


Introduction


The SDKs from the Unico IDCloud platform aim to enhance the security of your business and your clients, even allowing you to personalize the user experience by applying your brand's visual identity. The SDKs abstract the complexity of handling the user's device camera and capturing images (Selfie and document), making life easier for developers and reducing the time to deliver the final product. Other advantages:

  • Image Capture Accuracy: The SDKs have features that help the user obtain biometrically valid photos, reducing image drop rates compared to captures made by standard device cameras. SmartFrames are added, which are "key elements" that automatically adjust to the user's silhouette and screen proportions, allowing for better image capture.

  • Enhanced Security: Encryption features and protection against image injection, also including functionalities that prevent fraud, adapted to different camera modes. Security layers that work complementarily, both at the application level and in relation to the data transmitted between the SDKs and the backend. The SDK also includes code obfuscation, emulator blocking, and app bundle verification for the app executing it.

SDK Updates

It is important to emphasize that for the proper functioning of our solutions, with maximum security and stability, it is essential that the SDK is properly updated. It is the client's responsibility to monitor and ensure that they are using the latest version of the SDK available on our servers.

Operational Diagram


The SDK (Client-side) is responsible for simplifying your integration with the Unico IDCloud platform, handling all the complexity of camera manipulation and image capture.

If the capture is successful, the SDK returns an object that must be sent to the biometric engine API, thus completing the biometric validation, as illustrated in the diagram below:

1

The user accesses their application

2

Through the SDK, your application requests the frame for capture (according to how your application has been configured).

3

Your application renders the capture frame in a pre-established placeholder.

4

The SDK captures the image, generating a JWT token that will be returned to your application.

5

Your application passes the JWT to your server.

6
7

The servers return the response from the biometric engine, which must be sent to your application.

8

Your application provides a response to the user.

Requirements Supported by Each Client SDK


Below are the necessary information and requirements officially supported by each Unico Client SDK:

SDK Android
SDK iOS
SDK Web
  • Plugins: Flutter

  • Linguagens: Java/Kotlin

  • Xcode: >= 15.0

  • Plugins: Flutter

  • Linguagens: swift/objective-c

  • iOS: >= 11

  • Dependency manager: Cocoapods ou Swift Package Manager

  • Frameworks: React JS, Angular, Next JS, Vue JS e JS Vanilla.

  • Versão Javascript: ECMAScript 5 or higher.

Our support is restricted to applications developed directly on the native Android and iOS platforms, using their respective native modules, as well as the Flutter framework (if the implementation uses our plugin). At this time, we do not offer support for applications developed using hybrid frameworks such as React Native, Ionic, or other cross-platform development technologies.

Versioning of the SDKs


The SDKs of the Unico IDCloud platform follow semantic versioning, which means there is a version number in the format "MAJOR.MINOR.PATCH", described as follows:

  • Major Version (MAJOR): When making incompatible changes to the API;

  • Minor Version (MINOR): When adding functionality while maintaining compatibility;

  • Patch Version (PATCH): When fixing bugs while maintaining compatibility.


Webhook

In this section, you will find information about how the Webhook of the Unico IDCloud platform works


The respective GetProcess articles for the integration methods describe a way to obtain the status of a process through a call to an endpoint. This enables polling to receive information about the created processes. This means that the endpoint can be called multiple times for the same process to obtain the most recent status.

With the use of webhooks, it is possible to notify a specific endpoint every time the status of a process is changed.


A webhook is a systemic notification service that allows asynchronous integration between systems, where one system notifies the other through a trigger. This way, webhooks can keep systems updated with the latest information without the need for constant polling for updates.

How to Configure the Webhook


To configure the webhook, the following information is required:

  • Notification URL: This is the endpoint used by By Unico for notifications about status updates.

  • Authentication Type: This is the authentication method used to invoke the endpoint. The following options are available:

    • OAuth2;

    • Basic Authorization;

    • API Key;

    • No authentication.

  • For OAuth2, the following information needs to be provided:

    • Webhook endpoint ;

    • OAuth2 provider URL ;

    • OAuth2 provider ClientId ;

    • OAuth2 provider Secret .

  • For Basic Authorization, it is necessary to send in the format user:pass.

  • For API Key, two formats are possible:

    • header:value, when a specific header name is desired;

    • value, when the desired header is Authorization.

  • Retry Settings: Indicates the number of attempts in case of a failure in calling the endpoint:

    • Maximum number of attempts

    • Interval between attempts (in seconds)

    • Rate Limit: Maximum number of simultaneous sends (maximum: 500).

    • Timeout: Maximum wait time for the endpoint's response (in seconds).

  • Status to be Notified: Currently, the notification is sent whenever the state of a process changes to:

by Unico
by Client
  • finished: Process finished.

  • 2: In divergence;

  • 3: Completed;

  • 4: Canceled;

  • 5: Error.

About Authentication:

The API can be protected by an authentication method such as Basic Authentication or API Key. A list of valid IPs for access can also be defined for additional protection.

Integration with the Unico IDCloud Platform


When configuring a webhook on the platform, you can receive information about processes through notifications sent to an endpoint of the API developed by you to receive these updates.

The information sent by the platform to the API includes:

by Unico
by Client
  • processId: ID of the transaction;

  • state: State of the transaction;

  • flow: Journey of the transaction.

  • id: ID of the transaction;

  • status: State of the transaction.


The request must be a POST method in a REST API, making it easier and more secure to send the information. All fields must be mandatory. The body of the request must accept the transaction ID and the status, as shown in the following example:

{
  "processId": "8263a268-5388-492a-bca2-28e1ff4a69f0",
  "state": "PROCESS_STATE_FINISHED",
  "flow": "id"
}
{
  "id": "8263a268-5388-492a-bca2-28e1ff4a69f0",
  "status": 3
}

About the response status:

Currently, the platform has a set of statuses that may change in the future. Therefore, it is recommended that the statuses you are interested in for taking action be configurable.

Response


The response should be synchronous. The status for successful requests must be in the range of 200 to 299. Any other status is considered a failure, and the platform will then retry the notifications (with exponential backoff between attempts), until receiving a 2xx response or reaching the maximum number of retries.

Rate limit

In order to avoid overloading your resources in situations of high transaction volume, it is possible to specify an upper limit on the number of times the endpoint can be invoked.

Error rate

The error rate (responses outside the [200, 299] range) should always be low. Otherwise, the webhook throughput will be automatically reduced, and this reduction, along with the retry mechanism, may lead to an increase in the execution time of new webhooks.

Idempotency

The current webhook implementation guarantees at-least-once delivery, meaning the same status may be notified more than once. Therefore, the endpoint implementation must be idempotent.

Fallback

In case of any unavailability in the webhook service, it is recommended to have a fallback method in place so that you can continue receiving transaction statuses within the established response time. The query to the endpoint is described in the GetProcess sections for each integration method.


Selfie Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Android applications for selfie capture


Initializing the SDK


Create an instance of the builder (generated through the IAcessoBioBuilder interface), providing the context and environment as parameters, along with the implementation of the AcessoBioListener class.

The implementation of this class is quite simple and can be done in just a few lines of code. All you need to do is instantiate the builder by providing the relevant context and override the callback methods with the business logic of your application:

public class MainActivity extends AppCompatActivity {

    private AcessoBioListener callback = new AcessoBioListener() {
        @Override
        public void onErrorAcessoBio(ErrorBio errorBio) { }

        @Override
        public void onUserClosedCameraManually() { }

        @Override
        public void onSystemClosedCameraTimeoutSession() { }

        @Override
        public void onSystemChangedTypeCameraTimeoutFaceInference() { }
    };

    private IAcessoBioBuilder acessoBioBuilder = new AcessoBio(this, callback);
}
internal class MainActivity : AppCompatActivity() {

    private val callback = object : AcessoBioListener {
        override fun onErrorAcessoBio(errorBio: ErrorBio?) { }
    
        override fun onUserClosedCameraManually() { }
    
        override fun onSystemClosedCameraTimeoutSession() { }
    
        override fun onSystemChangedTypeCameraTimeoutFaceInference() { }
    }

    private val acessoBioBuilder: IAcessoBioBuilder = AcessoBio(this, callback)
}

Environment configuration


Configure the environment that will be used during the SDK execution. Use the Environment enum, which contains the following options:

  • Environment.PROD: for production environment;

  • Environment.UAT: for approval environment.

See how to implement it in the example below:

acessoBioBuilder.setEnvironment(Environment.UAT);
acessoBioBuilder.setEnvironment(Environment.UAT);

Implementing Callback Functions


Note that the work of implementing the AcessoBioListener class is, for the most part, configuring the callback methods. Each method is called in a specific situation based on the SDK's return.

Simply override the methods shown in the previous step with your application's business logic.

This method is invoked whenever any implementation error occurs while using one of our methods:

1

onErrorAcessoBio(ErrorBio errorBio)

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as when clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is invoked as soon as the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can change the maximum session time for your user when using the face detection feature (Selfie camera with smart capture). If the user exceeds the time set for capturing the photo, you can display a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked as soon as the maximum time for face detection is reached (without detecting anything). In this case, the camera mode is automatically switched to manual capture mode (without the smart capture outline).

The maximum capture time when using face detection (Selfie camera with smart capture) is 13 seconds. If the user encounters difficulty capturing the photo through face detection and exceeds the time set in the process, the capture is automatically switched to manual mode, aiming to make the action easier for the user (TimeoutToFaceInference).

All of the above methods must be created as indicated in your project (even if without any logic). Otherwise, the project will not compile successfully.

Configuring Camera Mode


The SDK has smart framing and automatic capture configured and enabled by default. As a result, you must configure the camera mode in your builder as follows:

UnicoCheckCamera unicoCheckCamera = acessoBioBuilder
    .setAutoCapture(true)
    .setSmartFrame(true)
    .build();
val unicoCheckCamera: UnicoCheckCamera = acessoBioBuilder
    .setAutoCapture(true)
    .setSmartFrame(true)
    .build()

The false/true values of the methods above do not alter the capture experience; they are only used for the internal logic of the SDK's operation.

Implementing Listeners for Camera Events


The implementation of these listener methods must be done through an instance of the iAcessoBioSelfie class.

The camera opening method, which is called in the next step, needs to know what to do when it successfully captures an image or when an error occurs in the process. It is necessary to inform "what to do" to the camera opening method by implementing listeners that are called in cases of success or error.

Through the configuration of the listeners, you can specify what happens in your app in error situations (onErrorSelfie method) or success situations (onSuccessSelfie method) during image capture.

Changes in naming conventions for versions lower than 4.2.1:

  • The method prepareCamera, which was previously prepareSelfieCamera.

  • The class CameraListener, which was previously SelfieCameraListener.

  • The object UnicoCheckCameraOpener.Camera, which was previously UnicoCheckCameraOpener.Selfie.

To configure the listeners, it is necessary to implement:

iAcessoBioSelfie cameraListener = new iAcessoBioSelfie() {
    @Override
    public void onSuccessSelfie(ResultCamera result) { }

    @Override
    public void onErrorSelfie(ErrorBio errorBio) { }
};

unicoCheckCamera.prepareCamera(unicoConfig, new CameraListener() {
    @Override
    public void onCameraReady(UnicoCheckCameraOpener.Camera cameraOpener) {
        cameraOpener.open(cameraListener);
    }

    @Override
    public void onCameraFailed(String message) {
        Log.e(TAG, message);
    }
});
val cameraListener: iAcessoBioSelfie = object : iAcessoBioSelfie {
    override fun onSuccessSelfie(result: ResultCamera?) {}

    override fun onErrorSelfie(errorBio: ErrorBio?) {}
}

unicoCheckCamera.prepareCamera(unicoConfig, object : CameraListener {
    override fun onCameraReady(cameraOpener: UnicoCheckCameraOpener.Camera?) {
        cameraOpener?.open(cameraListener)
    }

    override fun onCameraFailed(message: String?) {
        Log.e(TAG, message)
    }
})

Prepare and open the camera


When the camera is prepared, the onCameraReady event is triggered, which receives an object of type UnicoCheckCameraOpener.Camera as a parameter.

It is necessary to override this method, opening the camera with the object received through the open() method. The open() method should receive as parameters the listeners configured in the previous steps.

onSucessSelfie Method


When an image capture is successful, this method is invoked and returns an object of type ResultCamera, which is used later in the REST API calls:

public void onSuccessSelfie(ResultCamera result) { }

The ResultCamera object returns two attributes: base64 and encrypted:

  • The base64 attribute can be used if you want to display a preview of the image in your app.

  • The encrypted attribute is strictly intended for sending the image through the by Client APIs. It should not be opened or serialized, as its characteristics may change without notice. Its use must be exclusive to interactions with the APIs to ensure data integrity and security. Unico is not responsible for any damages resulting from this practice, as modifications can occur unexpectedly.

  • The base64/encrypted files may vary in size due to several factors, including the quality of the devices and the photos generated by them, as well as Unico's business rules. To avoid issues in your application, do not limit the size of the string generated by the SDK for the files in your programming logic or infrastructure.

onErrorSelfie Method


When an error occurs during image capture, this method is invoked and returns an object of type ErrorBio:

public void onErrorSelfie(ErrorBio errorBio) { }

Making a POST Request to the Client API


For security reasons, the interval between the generation of the encrypted and its submission via one of the available flows must be a maximum of 10 minutes. Submissions made beyond this period will be automatically rejected by the API.


Troubleshooting

In this section, you will find solutions to some common issues encountered during the integration of the Unico IDCloud SDK into your Android applications


Code Obfuscation


The obfuscation material is intended to assist the developer in overcoming obfuscation issues in their application.

The client's obfuscator can affect the functionality of the SDK, so it is necessary that it does not obfuscate the SDK code.

Unico is not responsible for any obfuscation conflicts with the SDK.

Obfuscation is a process of transforming the bytecode into a form that is less readable by humans, thereby making reverse engineering more difficult.

This process involves removing debugging-related information such as variable tables, line numbers, and renaming packages, classes, and methods.

When embedding the Android SDK in the application, issues may occur.

Obfuscation via DexGuard


When obfuscation is performed via DexGuard, in case of failure, use the following rules:

Obfuscation via ProGuard


When obfuscation is performed via ProGuard, in case of failure, use the following rules:


SDK Update - Version 4.3.x


Update the Maven Repository:


Change the Maven repository to the new repository in the project's build.gradle file.

The implementation was done as follows:

It should now be updated to the new repository:

Change the SDK Dependency


Change the SDK dependency to the new dependency in the app/build.gradle file of the project.

The implementation was done as follows:

It should now be updated to the new dependency:


Error Handling Guide

In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Android applications



This object is returned whenever an error occurs in the Android SDK.

Available Methods


Below is the list of possible error codes for the Android SDK:


Release notes

In this section, you will find all the updates for the Unico IDCloud Android SDK


Keep your Android SDK always updated with the latest available version.

Update Guide for Version 5.x.x

The major update being implemented from version 5.x.x should have been made in the release of version 4.4.0. This change is related to code obfuscation and requires adjustments in the ProGuard and DexGuard rules for clients using the GuardSquare library.


Critical Update

  • Enhanced detection and protection against injection attacks on both the device and server, leveraging artificial intelligence;

  • Critical reinforcements in the RASP layer, improving the detection of critical threats and implementing measures to eliminate continuous exploitation by fraudsters;

  • Improvements in the liveness engine layer to counter recurring attacks in the market.


  • Internal dependency adjustments ensuring compatibility with kotlin 1.6.0.


  • Rear camera support in physical store flows;

  • Update of the Liveness SDK and server with interaction;

  • Internal product improvements. These improvements do not directly affect the end user experience, keeping the interface and external functionalities unchanged.



  • Update SDK and Server version of Liveness with interaction.


  • Update SDK and Server version of Liveness with interaction.


  • Update SDK and Server version of Liveness with interaction.

In this version, we updated the compileSdkVersion to API 34, in compliance with Google Play policies.


  • Update SDK and Server version of Liveness with interaction.


  • Update SDK and Server version of Liveness with interaction.


  • SDK Update and Liveness Server Interaction;

  • Internal Improvements.


Document Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your Android applications for document capture


Available Document Frames


In this camera mode, there is a capture frame to assist the user in positioning the document correctly. Once the document is correctly positioned, the user must click the button to capture the photo of the document.

The SDK does not perform any type of validation on what is being captured.

In this camera mode, it is possible to capture the following documents:

  • CPF: Capture the front of the CPF;

  • CNH: Capture the open CNH;

  • CNH Front: Capture the front of the CNH;

  • CNH Back: Capture the back of the CNH;

  • RG Front: Capture the front of the RG;

  • RG Back: Capture the back of the RG;

  • Others: Capture any other document.

Initializing the SDK


Create an instance of the builder (generated through the IAcessoBioBuilder interface), providing the relevant context and the implementation of the AcessoBioListener class as parameters.

The implementation of this class is quite simple and can be done with just a few lines of code. All you need to do is instantiate the builder by specifying the context and override the callback methods with the business logic of your application:

Implementing Callback Functions


Note that the work of implementing the AcessoBioListener class is largely about configuring the callback methods. Each method is called in a specific situation based on the SDK's return.

Simply override the methods shown in the previous step with your application's business logic:

1

onErrorAcessoBio(ErrorBio errorBio)

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is invoked as soon as the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can change the maximum session time for your user when using the face detection feature (Selfie camera with smart capture). If the user exceeds the time set in your process to capture the photo, you can display a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked as soon as the maximum time for detecting the user's face is reached (without detecting anything). In this case, the camera mode is automatically switched to manual capture mode (without the smart capture outline).

The maximum capture time when using face detection (Selfie camera with smart capture) is 13 seconds. If the user encounters difficulty capturing the photo through face detection and exceeds the time set in the process, the capture is automatically switched to manual mode, aiming to make the action easier for the user (TimeoutToFaceInference).

All the above methods must be created as indicated in your project (even without any logic). Otherwise, the project will not compile successfully.

Implementing Listeners for Camera Events


The implementation of these listener methods must be done through an instance of the iAcessoBioSelfie class.

The camera opening method, which is called in the next step, needs to know what to do when it successfully captures an image or when an error occurs in the process. It is necessary to inform "what to do" to the camera opening method by implementing listeners that are called in cases of success or error.

Through the configuration of the listeners, you can specify what happens in your app in error situations (onErrorDocument method) or success situations (onSuccessDocument method) during image capture.

The example below illustrates the configuration of the listeners, building, and opening of the camera:

Prepare and open the camera


It is necessary to create an instance of the builder using the build() method. This method is provided through the object generated with the IAcessoBioBuilder interface and the AcessoBio class:

The next step is to prepare the camera using the prepareDocumentCamera() method with the object returned by the builder (named UnicoCheckCamera in the example above).

The prepareDocumentCamera() method generates an object of type UnicoCheckCameraOpener.Document, which is used to open the camera with its open() method, receiving the parameters for the type of document to be captured, which are:

If you need to capture a document for which we don't have a specific frame (e.g., RNE, among others), use the DocumentCameraType.None frame, which will provide you with a generic, rectangular frame that can be used to guide any capture.

onSucessDocument Method


When an image capture is successful, this method is invoked and returns an object of type ResultCamera, which is later used in the REST API calls:

The ResultCamera object returns two attributes: base64 and encrypted:

  • The base64 attribute can be used if you want to display a preview of the image in your app.

onErrorDocument Method


When an error occurs during image capture, this method is invoked and returns an object of type ErrorBio:

Making a POST Request to the Client API



Selfie Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your iOS applications for selfie capture


Initializing the SDK


To get started with the Unico Check iOS SDK, import the SDK and implement the AcessoBioManagerDelegate interface within the ViewController you want to use.

The implementation of this class is straightforward and can be done with just a few lines of code. All you need to do is instantiate the builder, providing the context and environment in question, and override the callback methods with the business logic of your application:

Environment configuration


Configure the environment that will be used to run the SDK. Use the enumerated environment that contains the following enumerates:

  • PROD: for production environment;

  • UAT: for approval environment.

See how to implement it in the example below:

Implementing the Callback Functions


Note that, as shown in the previous example, the implementation of the AcessoBioManagerDelegate interface mainly involves configuring the callback methods. Each method is called in a specific situation in the SDK's return process.

You simply need to override the methods demonstrated in the previous step with the business logic of your application:

1

onErrorAcessoBioManager(_ error: ErrorBio!)

This method is invoked when any implementation error occurs while using one of the methods, such as providing an incorrect document type for the document capture functionality.

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is invoked as soon as the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can change the maximum session time for your user by using the face detection feature (Selfie camera with smart capture). If the time exceeds the duration specified for the process to capture the photo, you can display a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked as soon as the maximum time for detecting a user's face is reached (without detecting anything). In this case, the camera mode is automatically switched to manual capture mode (without the intelligent capture silhouette).

The maximum capture time when using face detection (Selfie camera with smart capture) is 13 seconds. If the user encounters any difficulty capturing the photo through face detection and exceeds the time specified in the process, the capture automatically switches to manual mode to facilitate the user's action (TimeoutToFaceInference).

All the methods above must be created as indicated in your project (even without any logic). Otherwise, the project will not compile successfully.

Configuring Camera Mode


The SDK has intelligent framing and automatic capture configured and enabled by default. As a result, you should configure the camera mode in your builder as follows:

The false/true values for the methods above do not change the capture experience; they are only used for the internal logic of the SDK's functionality.

Implementing Delegates for Camera Events


The camera opening method needs to know what to do when it successfully captures an image or encounters an error during the process. "What to do" is informed to the camera opening method through the configuration of delegates that are called in success or error situations.

By configuring the delegates, you can specify what happens in your app in error situations (method onErrorSelfie) or success (method onSuccessSelfie) when capturing images.

To configure the delegates, you need to implement the SelfieCameraDelegate and AcessoBioSelfieDelegate interfaces:

onSuccessSelfie Method


When successfully capturing an image, this method is invoked and returns an object of type SelfieResult, which is later used in the REST API calls.

The ResultCamera object returns 2 attributes: base64 and encrypted:

  • The base64 attribute can be used if you want to display a preview of the image in your app.

  • The encrypted attribute is strictly intended for sending the image through the by Client APIs. It should not be opened or serialized, as its characteristics may change without prior notice. Its use should be exclusive in interactions with the APIs to ensure data integrity and security. Unico is not responsible for any damages resulting from this practice, as modifications can occur unexpectedly.

  • The base64/encrypted files may vary in size depending on various factors, including the quality of the devices and photos generated by them, as well as Unico’s business rules. To avoid issues in your application, do not limit the size of the string generated by the SDK for the files within your programming logic or infrastructure.

onErrorSelfie Method


When an error occurs during the image capture, this method is invoked and returns an object of type ErrorBio:

Environment Configuration


If not configured, the SDK uses the environment set through the configuration file (getHostKey). If getHostKey is not being used, an error will be returned.

It is possible to configure the environment to be used during the execution of the SDK. Use the EnvironmentEnum enumerated type, which contains the following values:

  • EnvironmentEnum.PROD: for the Production environment

  • EnvironmentEnum.UAT: for the Staging environment

See how to implement it in the example below:

Prepare and Open Camera


To proceed with opening the camera, you must first prepare it using the prepareSelfieCamera method. This method takes as parameters the implementation of the SelfieCameraDelegate class and the JSON containing the credentials generated in the previous step.

Once the camera is prepared, the onCameraReady event is triggered and receives an object of type AcessoBioCameraOpenerDelegate as a parameter.

You should override this method and open the camera using the object received through the open() method:

If any error occurs while preparing the camera, the onCameraFailed event is triggered. You should implement this method applying your app's business rules.

Making a POST Request to the Client API


For security reasons, the time interval between the generation of the encrypted and its submission via one of the available flows must be no more than 10 minutes. Submissions made beyond this period will be automatically rejected by the API.


Installation Guide

In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your iOS applications


Development Environment Preconditions


Your development environment must meet the following prerequisites:

Installing the iOS SDK


To implement the iOS SDK from the Unico IDCloud platform into your iOS application, follow the step-by-step instructions listed below:

1

Using CocoaPods

Include unicocheck-ios in your Podfile:

Next, simply use the command in your terminal to install the dependencies:

If you're running the project with a .xcodeproj file, you need to open the project with the .xcworkspace file.

2

Using Swift Package Manager (SPM)

Swift Package Manager is a dependency manager for Swift projects. It is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. To integrate the iOS SDK into your project using SPM, follow the instructions below:

Include the dependency in your Package.swift file:

3

Camera Usage Permissions

To use the camera opening method in your project, you need to add the necessary permissions before compiling your application:

4

Obtaining Credentials

  • Contact the CSs and/or the Onboarding team.

  • Request the SDK Key by providing the identifiers of your applications: Bundle Identifier for iOS, PackageID for Android, and Host for WEB.

  • The identifiers of your applications will be linked to the SDK Key by the Unico team.

  • You will receive your SDK Key to implement the AcessoBioConfigDataSource.

5

Embedding the Credentials in Your Project

  • Implement the AcessoBioConfigDataSource protocol in your class:

Deprecated Method - Swift


Android Customization

In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Android applications


The Android SDK allows for some customizations. Below, you can see all the possible customizations for this SDK.

Customize Language


It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes, which contains the following values:

  • LocaleTypes.PT_BR: for Portuguese(Brazil);

  • LocaleTypes.ES_MX: for Spanish(Mexico);

  • LocaleTypes.ES_ES: for Spanish(Spain);

  • LocaleTypes.EN_US: for English(USA).

See how to implement it in the example below:

  • A remote activation may be required to use it. If you wish to use it, please inform your project manager or Unico support.

  • If not configured, the SDK will use Portuguese as the default language.

Customize Capture Process Experience


Customize Selfie Capture Experience


This is an optional step, but highly recommended so that the capture process reflects your company's visual identity.

It is possible to customize some objects of the frame according to the camera mode used, through the setTheme() method.

The supported types for color representation are Color Resource or String containing the hexadecimal color code. Example: R.color.red or #FF0000.

All methods are available below:

It is also possible to make static customizations. In your colors.xml file, add the following code:

Below, check the field specification for the customization:

Customize Document Capture Experience


This is an optional step, but highly recommended so that the capture process reflects your company's visual identity.

It is possible to customize some objects of the frame according to the camera mode used, through the setTheme() method.

The supported types for color representation are Color Resource or String containing the hexadecimal color code. For example: R.color.red or #FF0000.

All methods are available below:

It is also possible to make static customizations. In your colors.xml file, add the following code:

Below, check the specification of the customization fields:


Logo customization
Accepted logo grids
Unaccepted logo formats
Button customization
Contrast examples
Rounding the button corners
Contextualization screen in by Unico

Its goal is to provide a wide range of possibilities for using the capabilities of the IDCloud platform, offering a solution that can be integrated into your back-end and providing freedom for clients who wish to control the user experience with their own front-end (for this, read about the ) or through our .

by Client is an integration method of Unico IDCloud that allows clients to integrate in any way they choose, combining or not combining the as they deem necessary. This integration method provides the necessary resources to perform Liveness, Identity Verification, Behavioral Alerts, Risk Score, and Document Reuse and Capture.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Liveness

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 1
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 1
}
Liveness

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 2
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 2
}
Liveness + Identity Verification

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}

Notes:

  • The "yes" response from unicoId.result (identity verification) already includes the validation of the Liveness capability. That is, if the response is "yes," it is understood that the user's face matches that of the CPF holder AND that the user was live at the time the selfie was taken.

Liveness + Identity Verification ❔

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1
}
Liveness + Identity Verification

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}
Liveness + Identity Verification ❔

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 2
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 2
}
Liveness + Identity Verification

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}
Liveness + Identity Verification

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "yes"
  }
}

Notes:

  • The "yes" response from unicoId.result (Identity Verification) already includes the validation of the Liveness capability. That is, if the response is "yes," it is understood that the user's face matches that of the CPF holder AND that the user was live at the time the selfie was taken;

  • When the response from unicoId.result (Identity Verification) is "yes," there will be no orchestration with the risk score capability.

Liveness + Identity Verification❔+ Risk Score

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 1,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1,
  "score": 50
}

Notes:

  • If you perform the GetProcess and the process is not yet completed, we will return statuses 1 or 2. Only make your final decision when you obtain a status of process completion (status = 3). You can also use the webhook to be notified when the process is completed.

Liveness + Identity Verification❔+ Risk Score

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 2
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 2
}

Notes:

  • When the response from liveness is 2, there will be no orchestration with the Risk Score

Liveness + Identity Verification❔+ Risk Score

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "inconclusive"
  },
  "liveness": 1
}

Notes:

  • When the status = 3 and the unicoId.result is "inconclusive," but we do not return the Risk Score, it is because there was an error (drop) in the biometric engine that could not generate the risk probability score.

Liveness + Identity Verification + Risk Score

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Notes:

  • When the status = 3 and the unicoId.result is "no," there will be no orchestration with the Risk Score capability.

Liveness + Identity Verification + Risk Score

Response CreateProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Response GetProcess

{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "unicoId": {
    "result": "no"
  }
}

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Note: Images taken from the guide "ICAO Guide for MRTD Photo Guidelines. ICAO. Icao guide for mrtd photo guidelines.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can learn more about generating an access token .

UAT: ;

Production: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Have version 9 or higher of installed (Google's official development IDE);

Done. Once the SDK installation is complete, proceed to the implementation by reading the following :

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

How do I update?

You can follow the standard update or installation process described according to the version you are using: , , , and .

Can there be API contract breaks due to this policy?

API contract breaks are restricted to Major version releases only . This means that significant changes to the API contract can only occur with major changes to the SDK, and not in minor revisions. We make it a practice to avoid any Major version breaks as much as possible, as it leads to major changes in the client integration, which is not our goal. We will only do so in cases of extreme necessity, always with the aim of ensuring security in all operations.

Each version has its own release notes, available through the links below, showcasing new features or bug fixes / fraud blocks: , , , and .

Whenever a new SDK version is released, the website is updated. If you are a Unico client, you will receive an email with the updates and information about the changes. If you are not receiving it, please contact your CSM.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Liveness: The SDKs are used in conjunction with the capability to ensure that the user is alive at the moment of capturing the selfie.

The image capture through the SDKs is just the first part of the journey. Therefore, it is extremely important to understand the basic concepts and how the biometric engine APIs work. For more information, see the REST API of the .

Unico is not responsible for issues arising from the lack of SDK updates in the client's operation. [

Your server interacts with the biometric engine APIs to analyze the image (through the REST APIs).

Android: 5.0 (API 21)

Kotlin: 1.6

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

What is a Webhook?

Requests

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been designed to help you implement the Android SDK quickly and easily. Below, you'll find a step-by-step process for the entire integration. Afterward, if you wish to customize the experience, be sure to check out the section.

When invoked, the method receives a parameter of type ErrorBio that contains details about the error. Learn more about the ErrorBio type in the section.

To proceed with opening the camera, it is first necessary to prepare it using the prepareCamera method. This method receives as parameters the implementation of the CameraListener class, the class, or the JSON with the credentials generated in.

The encrypted attribute must be sent in the REST API calls to.

Learn more about the ErrorBio types in the section of the SDK.

If it's necessary to convert base64 to bitmap, the standard method doesn't work for Android. It is necessary to perform a split at the comma (,) for it to work. If you'd like to learn more, read the article:

Image capture is just the first part of the journey. After capturing the image, it is necessary to send the encrypted generated by the SDK to the by Client REST APIs. Learn more in the CreateProcess section of

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Starting from version 4.4.x of the SDK, Unico began using its own Maven repository to distribute the Android SDK and changed the name of the SDK dependency, along with adjustments to ProGuard and DexGuard rules for clients using the GuardSquare library, as described in the section above.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

ErrorBio Object

Method Name
Description
Code
Description

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Semantic versioning is used to number the versions. For more information, refer to the article .

Additionally, the repository where the SDK is provided has changed, and there has also been a change in the SDK dependency name. You should update your records according to the article .

Version 5.32.0 - 25/03/2025

Version 5.31.0 - 27/02/2025

Version 5.30.0 - 25/02/2025

Version 5.29.0 - 21/01/2025

Version 5.28.0 - 09/01/2025

Version 5.27.0 - 18/12/2024

Version 5.26.0 - 21/11/2024

Version 5.25.0 - 04/11/2024

Version 5.24.0 - 17/10/2024

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been created to help you implement the Android SDK quickly and easily. Below, you will find a step-by-step process for the entire integration. Afterward, if you wish to customize the experience, be sure to check out the section.

This method is invoked with a parameter of type ErrorBio, which contains details about the error. Learn more about the ErrorBio type in the section.

Parameter
Description

Both the encrypted and base64 attributes can be sent in the REST API calls to .

If it's necessary to convert base64 to bitmap, the standard method doesn't work for Android. You need to perform a split at the comma (,) for it to work. If you'd like to learn more, read the article

Learn more about the ErrorBio types in the section of the SDK.

Capturing the images is just the first part of the journey. After capturing the image, it is necessary to send the base64 generated by the SDK to the by Client REST APIs. Learn more in the

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been created to help you implement the Unico iOS SDK quickly and easily. Below is the step-by-step process for the entire integration. Afterward, if you wish to personalize the experience, be sure to check the section.

When invoked, the method will receive a parameter of type ErrorBio that contains details of the error. For more information on the ErrorBio type, refer to the article in this SDK documentation.

The encrypted attribute must be sent in the REST API calls of

If you want to convert the base64 to bitmap, the standard method doesn’t work for iOS. You need to split the string starting from the comma (,) to make it work. To learn more, read this article:

Learn more about the types of ErrorBio in the SDK section.

The The ErrorPrepare type is an extension of ErrorBio, thus containing all of its properties. Learn more about the ErrorBio type in the section of the SDK.

Capturing the images is only the first part of the journey. After capturing the image, it is necessary to send the encrypted generated by the SDK to the by Client REST APIs. Learn more in the section of by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

The capture component provided through the iOS SDK is compatible with all devices running iOS 11 or later. You can check the list of compatible devices on the official Apple .

CocoaPods is a dependency manager for Cocoa projects. For installation and usage instructions, visit the official documentation. To integrate the iOS SDK into your Xcode project using CocoaPods, follow the instructions below:

Deprecated Method - Objective-C

Done. After completing the SDK installation, proceed to the implementation by reading the following material: :

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
Capture Standard
SDKs
capabilities
​
Help Center
here
https://api.id.uat.unico.app
https://api.id.unico.app
​
Help Center
here
https://api.id.uat.unico.app
https://api.id.unico.app
​
Help Center
​
Help Center
​
Help Center
here
https://api.id.uat.unico.app
https://api.id.unico.app
​
Help Center
http://www.icao.int/Security/mrtd/Downloads/TechnicalReports/Annex_A-Photograph_Guidelines.pdf
​
Help Center
here
https://api.id.uat.unico.app
https://api.id.unico.app
​
Help Center
Usage and Integration Guide
​
Help Center
​
Web
iOS
Android
Flutter
​
(learn more about semantic versioning here)
Android
iOS
Flutter
Web
https://unicoidtech.gitbook.io/idcloud/integracao/sdk
​
Help Center
Liveness
by Client
Learn more about our SDK Update Policy here]
By Client
​
Help Center
​
​
​
Help Center
Android Customization
error handling
this step
by Client
error handling
How to convert a Base64 string into a Bitmap image to show it in an ImageView?
by Client.
​
Help Center
-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.facetec.sdk.** { *; }
-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }
-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.facetec.sdk.** { *; }
-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io'}
    }
}
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
    repositories {
        google()
        jcenter()
        maven { 
            url "https://maven-sdk.unico.run/sdk-mobile" 
        }
    }
}
app/build.gradle
/* unico */
dependencies {
    implementation 'com.github.acesso-io:acessobio-android:$version'
}
app/build.gradle
/* unico */
dependencies {
    implementation "io.unico:capture:$version"
}

getCode()

Method used to obtain the error code that occurred.

getDescription()

Method used to obtain the description of the error that occurred.

73001

Context invalid

73002

Did not grant permission to open camera

73003

The lest API is 21(LOLLIPOP)

73004

Could not find implementation interface callback iAcessoBioSelfie

73005

Could not find implementation interface callback iAcessoBioDocument

73006

Unable to open camera on emulators

73100

Unable to connect to internet

73200

Please inform the json file name

73202

Unable to parse json file

73300

Unable to get unico authentication object

73301

Unable to parse object

73302

Could not find the unico token

73303

Current host is not registered

73400

Could not initialize camera

73500

Unable to get session token, service response error

73501

Unable to parce object

73502

Could not get session token

73701

Could not find active liveness import

73702

Unable to initialize active liveness in production mode

73703

Unable to get active liveness session

73704

The user pressed the cancel button and did not complete the Session.

73705

The Session was not performed successfully and a FaceScan was not generated. In general, other statuses will be sent to the

73706

The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to

73707

The Session was cancelled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the

73708

The Session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor

73709

The Session was cancelled because device is in reverse portrait mode. The user experience of devices in these orientations is

73710

The Session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set

73712

The Session was cancelled due to memory pressure.

73712

The Session was cancelled because your App is not in production and requires a network connection.

73713

The Session was cancelled because your key needs to be validated again.

73714

The Session was cancelled because the developer-configured encryption key was not valid.

73715

The Session was cancelled because not all guidance images were configured.

73716

The Session was cancelled because SDK was unable to start the camera on this device.

73717

The Session was cancelled because the user was in a locked out state.

73718

The Session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera,

73719

The Session cancelled because user pressed the Get Ready screen subtext message. Note: This functionality is not available by

73800

Could not build encrypted key

public class MainActivity extends AppCompatActivity {

    private AcessoBioListener callback = new AcessoBioListener() {
        @Override
        public void onErrorAcessoBio(ErrorBio errorBio) { }

        @Override
        public void onUserClosedCameraManually() { }

        @Override
        public void onSystemClosedCameraTimeoutSession() { }

        @Override
        public void onSystemChangedTypeCameraTimeoutFaceInference() { }
    };

    private IAcessoBioBuilder acessoBioBuilder = new AcessoBio(this, callback);
}
internal class MainActivity : AppCompatActivity() {

    private val callback = object : AcessoBioListener {
        override fun onErrorAcessoBio(errorBio: ErrorBio?) { }
    
        override fun onUserClosedCameraManually() { }
    
        override fun onSystemClosedCameraTimeoutSession() { }
    
        override fun onSystemChangedTypeCameraTimeoutFaceInference() { }
    }

    private val acessoBioBuilder: IAcessoBioBuilder = AcessoBio(this, callback)
}
iAcessoBioDocument cameraListener = new iAcessoBioDocument() {
    @Override
    public void onSuccessDocument(ResultCamera result) { }

    @Override
    public void onErrorDocument(ErrorBio errorBio) { }
};

unicoCheckCamera.prepareDocumentCamera(unicoConfig, new DocumentCameraListener() {
    @Override
    public void onCameraReady(UnicoCheckCameraOpener.Document cameraOpener) {
        cameraOpener.open(DocumentType.CNH, cameraListener);
    }

    @Override
    public void onCameraFailed(String message) {
        Log.e(TAG, message);
    }
});
val cameraListener: iAcessoBioDocument = object : iAcessoBioDocument {
    override fun onSuccessDocument(result: ResultCamera?) {}

    override fun onErrorDocument(errorBio: ErrorBio?) {}
}

unicoCheckCamera.prepareDocumentCamera(unicoConfig, object : DocumentCameraListener {
    override fun onCameraReady(cameraOpener: UnicoCheckCameraOpener.Document?) {
        cameraOpener?.open(DocumentType.CNH, cameraListener)
    }

    override fun onCameraFailed(message: String?) {
        Log.e(TAG, message)
    }
})
UnicoCheckCamera unicoCheckCamera = acessoBioBuilder.build();  
val unicoCheckCamera = acessoBioBuilder.build()

DocumentCameraType.CPF

Frame for capturing the front of the CPF.

DocumentCameraType.CNH

Frame for capturing the open CNH.

DocumentCameraType.CNH_FRENTE

Frame for capturing the front of the CNH.

DocumentCameraType.CNH_VERSO

Frame for capturing the back of the CNH.

DocumentCameraType.RG_FRENTE

Frame for capturing the front of the RG.

DocumentCameraType.RG_VERSO

Frame for capturing the back of the RG.

DocumentCameraType.None

Frame for capturing any other document.

public void onSuccessDocument(ResultCamera result) { }
public void onErrorDocument(ErrorBio errorBio) { }
.m:
#import "ViewController.h"
#import <AcessoBio/AcessoBio.h>

@implementation ViewController: UIViewController
- (void)viewDidLoad {
    [super viewDidLoad];  
    unicoCheck = [[AcessoBioManager alloc]initWithViewController:self];
}

- (void)onErrorAcessoBioManager:(ErrorBio *)error {
  // your code
}

- (void)onSystemChangedTypeCameraTimeoutFaceInference {
  // your code
}

- (void)onSystemClosedCameraTimeoutSession {
  // your code
}

- (void)onUserClosedCameraManually {
  // your code
}
@end
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate {
  var unicoCheck: AcessoBioManager!

  override func viewDidLoad() {
    super.viewDidLoad()      
    unicoCheck = AcessoBioManager(viewController: self)
  }

  func onErrorAcessoBioManager(_ error: ErrorBio!) {
      // your code
  }

  func onUserClosedCameraManually() {
      // your code
  }

  func onSystemClosedCameraTimeoutSession() {
      // your code
  }

  func onSystemChangedTypeCameraTimeoutFaceInference() {
      // your code 
  }
}
  [unicoCheck setEnvironment:UAT];
 unicoCheck.setEnvironment(.UAT);
.m:
- (IBAction)configureSmartCamera:(UIButton *)sender {
   [unicoCheck setSmartFrame:true];
   [unicoCheck setAutoCapture:true];
}
@IBAction func configureSmartCamera(_ sender: Any) {
    unicoCheck.setSmartFrame(true)
    unicoCheck.setAutoCapture(true)    
}
.h:
#import <UIKit/UIKit.h>
#import <AcessoBio/AcessoBio.h>
#import "SelfieCameraDelegate.h"

@interface ViewController: UIViewController <AcessoBioManagerDelegate, SelfieCameraDelegate,
   AcessoBioSelfieDelegate> {
  AcessoBioManager *unicoCheck;
  // Your code from previous and next steps here
}
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate,
                      SelfieCameraDelegate, AcessoBioSelfieDelegate {    
  //Your code from previous and next steps here
}
- (void)onSuccessSelfie:(SelfieResult *)result {
    NSLog(@"%@", result.base64);
} 
func onSuccessSelfie(_ result: AcessoBio.SelfieResult!) {
    // Your code
 }
- (void)onErrorSelfie:(ErrorBio *)errorBio {
  // Your code
}
func onErrorSelfie(_ errorBio: ErrorBio!) {
  // Your code
 }
[unicoCheck setEnvironment:PROD];
unicoCheck.setEnvironment(.PROD);
.h:
#import <UIKit/UIKit.h>
#import <AcessoBio/AcessoBio.h>
#import "SelfieCameraDelegate.h"

@interface ViewController: UIViewController <AcessoBioManagerDelegate,
SelfieCameraDelegate, AcessoBioSelfieDelegate> {
    AcessoBioManager *unicoCheck;
}

.m:
- (IBAction)openCamera:(UIButton *)sender {
    [[unicoCheck build] prepareSelfieCamera:self config:[YourUnicoConfigClass new]];
}
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate,
  SelfieCameraDelegate, AcessoBioSelfieDelegate {
    @IBAction func openCamera(_ sender: Any) {
        unicoCheck.build().prepareSelfieCamera(self, config: YourUnicoConfigClass())
    }
}
- (void)onCameraReady:(id)cameraOpener {
    [cameraOpener open:self];
}

- (void)onCameraFailed:(ErrorPrepare *)message {
    // Your code
}
func onCameraReady(_ cameraOpener: AcessoBioCameraOpenerDelegate!) {
    cameraOpener.open(self)
 }
 
func onCameraFailed(_ message: ErrorPrepare!) {
    // Your code
 }
podfile
pod ‘unicocheck-ios’
pod install
Package.swift
<uses-dependencies: [
    .package(url: "https://github.com/acesso-io/unico-check-ios.git", .upToNextMajor(from: "2.12.0"))
]
Info.plist
<key>NSCameraUsageDescription</key>
<string>Camera usage description</string>
.h:
#import <AcessoBio/AcessoBioManager.h>
#import <AcessoBio/AcessoBio-Swift.h>

@interface YourUnicoConfigClass: AcessoBioConfigDataSource {}
@end

.m:
@implementation YourUnicoConfigClass

- (NSString * _Nonnull)getBundleIdentifier {
    return @"<YOUR_MOBILE_BUNDLE_IDENTIFIER>";
}

- (NSString * _Nonnull)getHostKey {
    return @"<YOUR_SDK_KEY>";
}

@end
import AcessoBio

class YourUnicoConfigClass: AcessoBioConfigDataSource {
          
    func getBundleIdentifier() -> String {
        return "<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
    }
        
    func getHostKey() -> String {
        return "<YOUR_SDK_KEY>"
    }
}
.h:
#import <AcessoBio/AcessoBioManager.h>
#import <AcessoBio/AcessoBio-Swift.h>

@interface YourUnicoConfigClass: AcessoBioConfigDataSource {}
@end

.m:
@implementation YourUnicoConfigClass

- (NSString * _Nonnull)getBundleIdentifier {
    return @"<YOUR_MOBILE_BUNDLE_IDENTIFIER>";
}

- (NSString * _Nonnull)getHostInfo {
    return @"<YOUR_HOST_INFO>";
}

- (NSString * _Nonnull)getHostKey {
    return @"<YOUR_HOST_KEY>";
}

- (NSString * _Nonnull)getMobileSdkAppId {
    return @"<YOUR_MOBILE_SDK_APP_ID>";
}

- (NSString * _Nonnull)getProjectId {
    return @"<YOUR_PROJECT_ID>";
}

- (NSString * _Nonnull)getProjectNumber {
    return @"<YOUR_PROJECT_NUMBER>";
}

@end
import AcessoBio

class YourUnicoConfigClass: AcessoBioConfigDataSource {
        
    func getProjectNumber() -> String {
        return "<YOUR_PROJECT_NUMBER>"
    }
    
    func getProjectId() -> String {
        return "<YOUR_PROJECT_ID>"
    }
    
    func getMobileSdkAppId() -> String {
        return "<YOUR_MOBILE_SDK_APP_ID>"
    }
    
    func getBundleIdentifier() -> String {
        eturn "<YOUR_MOBILE_BUNDLE_IDENTIFIER>"
    }
    
    func getHostInfo() -> String {
        return "<YOUR_HOST_INFO>"
    }
    
    func getHostKey() -> String {
        return "<YOUR_HOST_KEY>"
    }
}
unicoCheck.setLocale(LocaleTypes.EN_US);
unicoCheck.setLocale(LocaleTypes.EN_US);
IAcessoBioTheme unicoTheme = new IAcessoBioTheme() {
    @Override
    public Object getColorBackground() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorBoxMessage() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorTextMessage() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorBackgroundPopupError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorTextPopupError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorBackgroundButtonPopupError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorTextButtonPopupError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorBackgroundTakePictureButton() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorIconTakePictureButton() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorBackgroundBottomDocument() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorTextBottomDocument() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorSilhouetteSuccess() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorSilhouetteError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorProgressBar() { 
        return R.color.your_color;
    }
};
    
acessoBioBuilder.setTheme(unicoTheme); 
val unicoTheme = object: IAcessoBioTheme {

    override fun getColorBackground() = R.color.your_color
    override fun getColorBoxMessage() = R.color.your_color
    override fun getColorTextMessage() = R.color.your_color
    override fun getColorBackgroundPopupError() = R.color.your_color
    override fun getColorTextPopupError() = R.color.your_color
    override fun getColorBackgroundButtonPopupError() = R.color.your_color
    override fun getColorTextButtonPopupError() = R.color.your_color
    override fun getColorBackgroundTakePictureButton() = R.color.your_color
    override fun getColorIconTakePictureButton() = R.color.your_color
    override fun getColorBackgroundBottomDocument() = R.color.your_color
    override fun getColorTextBottomDocument() = R.color.your_color
    override fun getColorSilhouetteSuccess() = R.color.your_color
    override fun getColorSilhouetteError() = R.color.your_color 
    override fun getColorSilhouetteNeutral() = R.color.your_color
    override fun getColorProgressBar() = R.color.your_color
}

acessoBioBuilder.setTheme(unicoTheme)
<color name="unico_color_background"> #YourColor </color> 
<color name="unico_color_silhouette_success"> #YourColor </color> 
<color name="unico_color_silhouette_error"> #YourColor </color> 
<color name="unico_color_silhouette_neutral"> #YourColor </color> 
<color name="unico_color_box_message"> #YourColor </color> 
<color name="unico_color_text_message"> #YourColor </color> 
<color name="unico_color_background_popup_error"> #YourColor </color> 
<color name="unico_color_text_popup_error"> #YourColor </color> 
<color name="unico_color_background_button_popup_error"> #YourColor </color> 
<color name="unico_color_text_button_popup_error"> #YourColor </color> 
<color name="unico_color_background_take_picture_button"> #YourColor </color> 
<color name="unico_color_icon_take_picture_button"> #YourColor </color> 
<color name="unico_color_background_bottom_document"> #YourColor </color> 
<color name="unico_color_text_bottom_document"> #YourColor </color> 
<color name="unico_color_button_cancel"> #YourColor </color> 
<color name="unico_color_progress_bar_capture"> #YourColor </color> 
IAcessoBioTheme unicoTheme = new IAcessoBioTheme() {
    @Override
    public Object getColorBackground() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorBoxMessage() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorTextMessage() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorBackgroundPopupError() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorTextPopupError() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorBackgroundButtonPopupError() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorTextButtonPopupError() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorBackgroundTakePictureButton() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorIconTakePictureButton() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorBackgroundBottomDocument() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorTextBottomDocument() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorSilhouetteSuccess() { 
        return R.color.your_color;
    }
    @Override
    public Object getColorSilhouetteError() { 
        return R.color.your_color;
    }

    @Override
    public Object getColorProgressBar() { 
        return R.color.your_color;
    }
};
    
acessoBioBuilder.setTheme(unicoTheme); 
val unicoTheme = object: IAcessoBioTheme {
    override fun getColorBackground() = R.color.your_color
    override fun getColorBoxMessage() = R.color.your_color
    override fun getColorTextMessage() = R.color.your_color
    override fun getColorBackgroundPopupError() = R.color.your_color
    override fun getColorTextPopupError() = R.color.your_color
    override fun getColorBackgroundButtonPopupError() = R.color.your_color
    override fun getColorTextButtonPopupError() = R.color.your_color
    override fun getColorBackgroundTakePictureButton() = R.color.your_color
    override fun getColorIconTakePictureButton() = R.color.your_color
    override fun getColorBackgroundBottomDocument() = R.color.your_color
    override fun getColorTextBottomDocument() = R.color.your_color
    override fun getColorSilhouetteSuccess() = R.color.your_color
    override fun getColorSilhouetteError() = R.color.your_color
    override fun getColorSilhouetteNeutral() = R.color.your_color
    override fun getColorProgressBar() = R.color.your_color
}
acessoBioBuilder.setTheme(unicoTheme)
<color name="unico_color_background"> #YourColor </color> 
<color name="unico_color_silhouette_success"> #YourColor </color> 
<color name="unico_color_silhouette_error"> #YourColor </color> 
<color name="unico_color_silhouette_neutral"> #YourColor </color> 
<color name="unico_color_box_message"> #YourColor </color> 
<color name="unico_color_text_message"> #YourColor </color> 
<color name="unico_color_background_popup_error"> #YourColor 
<color name="unico_color_text_popup_error"> #YourColor </color> 
<color name="unico_color_background_button_popup_error"> #YourColor 
<color name="unico_color_text_button_popup_error"> #YourColor </color> 
<color name="unico_color_background_take_picture_button"> #YourColor </color> 
<color name="unico_color_icon_take_picture_button"> #YourColor </color> 
<color name="unico_color_background_bottom_document"> #YourColor </color> 
<color name="unico_color_text_bottom_document"> #YourColor </color> 
<color name="unico_color_button_cancel"> #YourColor </color> 
<color name="unico_color_progress_bar_capture"> #YourColor </color> 
LogoGuia de uso e integração* | IDCloud APIs

Usage and Integration Guide

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Flutter applications

Usage and Integration Guide

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Webapplications

GetProcess

get

Endpoint to get the result of a process in by Unico.

Authorizations
Path parameters
processIdstringRequired

Process ID.

Responses
200
Process details retrieved successfully.
application/json
400
When the process ID is invalid.
application/json
401
Access token error.
application/json
404
When the process cannot be found.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
get
GET /client/v1/process/{processId} HTTP/1.1
Host: api.cadastro.uat.unico.app
Authorization: Bearer JWT
Accept: */*
{
  "process": {
    "id": "53060f52-f146-4c12-a234-5bb5031f6f5b",
    "flow": "idunicosign",
    "callbackUri": "/path/to/callback-url/",
    "userRedirectUrl": "https://cadastro.dev.unico.app/process/53060f52-f146-4c12-a234-5bb5031f6f5b",
    "state": "PROCESS_STATE_FINISHED",
    "result": "PROCESS_RESULT_OK",
    "createdAt": "2023-10-05T18:28:58.537985Z",
    "finishedAt": "2023-10-09T15:15:25.417105Z",
    "person": {
      "duiType": "DUI_TYPE_BR_CPF",
      "duiValue": "73689290074",
      "friendlyName": "Luke Skywalker",
      "notifications": [
        {
          "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
        }
      ]
    },
    "purpose": "creditprocess",
    "authenticationInfo": {
      "authenticationResult": "AUTHENTICATION_RESULT_INCONCLUSIVE",
      "authenticationId": "fd433602-d496-4291-adbb-dda95a3e50b1",
      "livenessResult": "LIVENESS_RESULT_LIVE",
      "bioTokenEngineResult": "BIO_TOKEN_ENGINE_RESULT_UNSPECIFIED",
      "identityFraudstersResult": "TRUST_RESULT_UNSPECIFIED",
      "scoreEngineResult": {
        "scoreEnabled": "SCORE_ENABLED_TRUE",
        "score": 50
      },
      "serproResult": {
        "score": 50
      }
    },
    "capacities": [
      "PROCESS_CAPACITY_IDUNICO",
      "PROCESS_CAPACITY_IDSIGN",
      "PROCESS_CAPACITY_IDLIVE"
    ],
    "services": [
      {
        "documents": [
          {
            "doc": {
              "version": 2,
              "code": "RG",
              "data": {
                "dataExpiracao": "2025-10-35T00:00:00Z",
                "dataHabilitacao": "2022-08-09T00:00:00Z",
                "dataNascimento": "1950-06-30T00:00:00Z",
                "nomeCivil": "John Doe",
                "rgNumero": 5478854,
                "categoria": "D",
                "cpfNumero": 73689290074,
                "dataEmissao": "2020-08-09T00:00:00Z",
                "localEmissao": "DEREX SP",
                "numero": 85775532778,
                "renachNumero": ""
              }
            },
            "typified": true,
            "cpf_match": true,
            "face_match": true,
            "doc_id": "1e61a978-3673-4fdd-8fa8-808d0a26d131",
            "validate_doc": true,
            "reused_doc": true,
            "signed_url": "https://api.datafortre[...]OXc9PQ%3D%3D"
          }
        ],
        "consent_granted": true,
        "envelopeId": "4d4f3d90-04a3-4259-b63b-930ab10d2e47",
        "documentIds": [
          "03307601-b518-49ca-b368-ae3919e24e54"
        ]
      }
    ],
    "expiresAt": "2023-10-09T15:15:25.417105Z",
    "token": "",
    "companyData": {
      "branchId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
      "countryCode": "BRA"
    }
  }
}
  • Type: CNH

  • Content: Brazilian National Driving License

    • String numero;

    • String rgNumero;

    • String cpfNumero;

    • String nomeCivil;

    • List string filiacao;

    • Datetime dataNascimento;

    • Datetime data_habilitacao;

    • Datetime data_expiracao;

    • Datetime data_emissao;

    • String local_emissao;

    • String categoria;

    • String renachNumero;

"content": {
    "numero": "044589731564",
    "rgNumero": "123456789 SESP PR",
    "nomeCivil": "Homer Simpson",
    "filiacao": [
        "Monasimpson",
        "Monasimpson"
    ],
    "dataNascimento": "1990-05-12T00:00:00Z",
    "dataHabilitacao": "1997-11-18T00:00:00Z",
    "dataExpiracao": "2017-12-07T00:00:00Z",
    "dataEmissao": "2012-12-07T00:00:00Z",
    "localEmissao": "Curitiba PR",
    "categoria": "B",
    "renachNumero": "PR904987581"
}
  • Type: RG

  • Content: Brazilian General Registration

    • String numero;

    • String orgao_emissor;

    • String uf_emissor;

    • String cpfNumero;

    • String carteira_profissionalNumero;

    • String certificado_militarNumero;

    • String cnsNumero;

    • String nis_pis_pasepNumero;

    • String ctpsNumero;

    • String ctps_serie;

    • String ctps_uf;

    • String titulo_eleitorNumero;

    • String nomeCivil;

    • String nome_social;

    • List string filiacao;

    • Datetime dataNascimento;

    • String naturalidade;

    • Datetime data_emissao;

"content": {
    "dataEmissao": "2012-12-21T02:00:00Z",
    "dataNascimento": "1980-12-19T03:00:00Z",
    "filiacao": [
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa",
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa"
    ],
    "naturalidade": "Sao Paulo SP",
    "nomeCivil": "Daniel Coelho Da Costa",
    "numero": "4815162342",
    "orgaoEmissor": "Secretaria Da Segurança Pública (SSP)",
    "ufEmissor": "UF_SP"
}
  • Type: CIN

  • Content: Brazilian national Identity Card

    • string rgNumero;

    • string cpfNumero;

    • string nomeCivil;

    • string nome_social;

    • List string filiacao;

    • Datetime dataNascimento;

    • Datetime data_expiracao;

    • Datetime data_emissao;

    • string orgao_emissor;

    • string local_emissao;

    • string naturalidade;

    • string nacionalidade;

"content": {
    "nomeCivil": "Vitor Ra",
    "nomeSocial": "Vitor Ra",
    "filiacao": [
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria",
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria"
    ],
    "dataExpiracao": "2034-03-02T00:00:00Z",
    "dataEmissao": "2024-03-02T00:00:00Z",
    "orgaoEmissor": "Detran/Rj",
    "localEmissao": "Rio De Janeiro RJ",
    "naturalidade": "Rio De Janeiro RJ",
    "nacionalidade": "BRA"
}
  • Type: Passport

  • Content: Brazilian Passport

    • string numero;

    • string nome;

    • string sobrenome;

    • string pais_emissor;

    • string nacionalidade;

    • string naturalidade;

    • Datetime data_nascimento;

    • Datetime data_emissao;

    • Datetime data_expiracao;

    • string autoridade.

"content": {
            "numero": "AA011906",
            "nome": "CHANCHÃO AMARELO",
            "sobrenome": "PASSAREDO",
            "paisEmissor": "BRA",
            "nacionalidade": "BRASILEIRO(A)",
            "naturalidade": "<nil>",
            "dataNascimento": "1920-06-01T00:00:00Z",
            "dataEmissao": "2000-01-01T00:00:00Z",
            "dataExpiracao": "2010-01-01T00:00:00Z",
            "autoridade": "SR/DPF/DF"
        }
  • Type: UNKNOWN

  • Content: Unknown document.

content {
}
  • Type: CNH

  • Content: Brazilian National Driving License

    • String numero;

    • String rgNumero;

    • String cpfNumero;

    • String nomeCivil;

    • List string filiacao;

    • Datetime dataNascimento;

    • Datetime data_habilitacao;

    • Datetime data_expiracao;

    • Datetime data_emissao;

    • String local_emissao;

    • String categoria;

    • String renachNumero;

"content": {
    "numero": "044589731564",
    "rgNumero": "123456789 SESP PR",
    "nomeCivil": "Homer Simpson",
    "filiacao": [
        "Monasimpson",
        "Monasimpson"
    ],
    "dataNascimento": "1990-05-12T00:00:00Z",
    "dataHabilitacao": "1997-11-18T00:00:00Z",
    "dataExpiracao": "2017-12-07T00:00:00Z",
    "dataEmissao": "2012-12-07T00:00:00Z",
    "localEmissao": "Curitiba PR",
    "categoria": "B",
    "renachNumero": "PR904987581"
}
  • Type: RG

  • Content: Brazilian General Registration

    • String numero;

    • String orgao_emissor;

    • String uf_emissor;

    • String cpfNumero;

    • String carteira_profissionalNumero;

    • String certificado_militarNumero;

    • String cnsNumero;

    • String nis_pis_pasepNumero;

    • String ctpsNumero;

    • String ctps_serie;

    • String ctps_uf;

    • String titulo_eleitorNumero;

    • String nomeCivil;

    • String nome_social;

    • List string filiacao;

    • Datetime dataNascimento;

    • String naturalidade;

    • Datetime data_emissao;

"content": {
    "dataEmissao": "2012-12-21T02:00:00Z",
    "dataNascimento": "1980-12-19T03:00:00Z",
    "filiacao": [
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa",
     "Rosa Coelho Da Costa",
     "Edivaldo Da Costa"
    ],
    "naturalidade": "Sao Paulo SP",
    "nomeCivil": "Daniel Coelho Da Costa",
    "numero": "4815162342",
    "orgaoEmissor": "Secretaria Da Segurança Pública (SSP)",
    "ufEmissor": "UF_SP"
}
  • Type: CIN

  • Content: Brazilian national Identity Card

    • string rgNumero;

    • string cpfNumero;

    • string nomeCivil;

    • string nome_social;

    • List string filiacao;

    • Datetime dataNascimento;

    • Datetime data_expiracao;

    • Datetime data_emissao;

    • string orgao_emissor;

    • string local_emissao;

    • string naturalidade;

    • string nacionalidade;

"content": {
    "nomeCivil": "Vitor Ra",
    "nomeSocial": "Vitor Ra",
    "filiacao": [
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria",
        "Danilo Luis Renan Ramos",
        "Giovanna Vitoria"
    ],
    "dataExpiracao": "2034-03-02T00:00:00Z",
    "dataEmissao": "2024-03-02T00:00:00Z",
    "orgaoEmissor": "Detran/Rj",
    "localEmissao": "Rio De Janeiro RJ",
    "naturalidade": "Rio De Janeiro RJ",
    "nacionalidade": "BRA"
}
  • Type: Passport

  • Content: Brazilian Passport

    • string numero;

    • string nome;

    • string sobrenome;

    • string pais_emissor;

    • string nacionalidade;

    • string naturalidade;

    • Datetime data_nascimento;

    • Datetime data_emissao;

    • Datetime data_expiracao;

    • string autoridade.

"content": {
            "numero": "AA011906",
            "nome": "CHANCHÃO AMARELO",
            "sobrenome": "PASSAREDO",
            "paisEmissor": "BRA",
            "nacionalidade": "BRASILEIRO(A)",
            "naturalidade": "<nil>",
            "dataNascimento": "1920-06-01T00:00:00Z",
            "dataEmissao": "2000-01-01T00:00:00Z",
            "dataExpiracao": "2010-01-01T00:00:00Z",
            "autoridade": "SR/DPF/DF"
        }
  • Type: UNKNOWN

  • Content: Unknown document.

content {
}
LogoGuia de uso e integração | IDCloud APIs
Android Studio
​
​
Code Obfuscation
​
Help Center
​
​
Help Center
Overview
SDK Update Version 4.3.x
​
​
​
​
​
​
​
​
​
​
Help Center
Android Customization
error handling
by Client
How to convert a Base64 string into a Bitmap image to show it in an ImageView?.
error handling
CreateProcess section of by Client.
​
Help Center
iOS Customization
error handling
by Client.
How to convert a Base64 string into a Bitmap image to show it in an ImageView?
error handling
error handling
CreateProcess
​
Help Center
support channels
CocoaPods
Usage and Integration Guide
​
Help Center
​
Help Center
Logo
Button
Contextualization

Create Process

post

Endpoint to create a new process at Unico.

Authorizations
Body
callbackUristringRequired

Defines where the user will be redirected at the end of the process. Possible values are: A URL (e.g., https://developers.unico.io/callback), a Schema URL for redirection in native mobile applications (e.g., br.com.meupacote.app://callback - the callback must be registered in your mobile app), or no redirection (just include '/').

Example: /
flowstring · enumRequired

Flow type. See flow details in the 'Overview' section of this documentation.

Example: idunicosignPossible values:
companyBranchIdstringOptional

The ID of the branch where the process will be created. If there is only one branch associated with the service account, this parameter is not required. If there is a separation of processes by branch, you will receive the branch IDs from the Unico team.

Example: 60837cd3-ed3c-4038-ad7c-0a85ad64b03a
bioTokenIdstringOptional

Biometric token identification. Mandatory for the "idtoken" flow and must use an ID from a completed process of any other identity verification flow.

Example: 60837cd3-ed3c-4038-ad7c-0a85ad64b03a
purposestring · enumRequired

Purpose of the process.

Example: creditprocessPossible values:
expiresInstringOptional

Expiration time of the process in seconds from its creation. The value must be in the format "10080s", with "s" at the end. If not provided, the default value of 7 days will be used.

Example: 3600s
Responses
200
Process successfully created.
application/json
400
Invalid payload.
application/json
401
Access token error.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
post
POST /client/v1/process HTTP/1.1
Host: api.cadastro.uat.unico.app
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 893

{
  "callbackUri": "/",
  "flow": "idunicosign",
  "flow_config": {
    "biometry_capture": {
      "enabled_back_camera": true
    }
  },
  "companyBranchId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
  "bioTokenId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
  "person": {
    "duiType": "DUI_TYPE_BR_CPF",
    "duiValue": "12345678909",
    "friendlyName": "Luke Skywalker",
    "phone": "5511912345678",
    "email": "teste@teste.com",
    "notifications": [
      {
        "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
      }
    ]
  },
  "purpose": "creditprocess",
  "expiresIn": "3600s",
  "contextualization": {
    "currency": "BRL",
    "price": 15990.9,
    "locale": {
      "ptBr": {
        "reason": "Abertura de cadastro"
      },
      "enUs": {
        "reason": "Identity validation for personal loan application"
      },
      "esMX": {
        "reason": "Validación de identidad para solicitud de préstamo personal"
      }
    }
  },
  "payload": [
    {
      "envelopePayload": {
        "documents": [
          {
            "documentName": "teste",
            "fileContents": "JVBERi0xLjMNCiXi48/[...]DQoNCnN0YXJ0eHJlZg0KMjcxNA0KJSVFT0YNCg=="
          }
        ]
      }
    }
  ]
}
{
  "process": {
    "id": "53060f52-f146-4c12-a234-5bb5031f6f5b",
    "companyBranchId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
    "flow": "idunicosign",
    "callbackUri": "/path/to/callback-url/",
    "userRedirectUrl": "https://cadastro.dev.unico.app/process/53060f52-f146-4c12-a234-5bb5031f6f5b",
    "state": "PROCESS_STATE_CREATED",
    "createdAt": "2023-10-09T15:15:25.417105Z",
    "person": {
      "duiType": "DUI_TYPE_BR_CPF",
      "duiValue": "73689290074",
      "friendlyName": "Luke Skywalker",
      "phone": "5511912345678",
      "email": "teste@teste.com",
      "notifications": [
        {
          "notificationChannel": "NOTIFICATION_CHANNEL_WHATSAPP"
        }
      ]
    },
    "purpose": "creditprocess",
    "authenticationInfo": {},
    "capacities": [
      [
        "PROCESS_CAPACITY_IDUNICO",
        "PROCESS_CAPACITY_IDLIVE",
        "PROCESS_CAPACITY_IDSIGN"
      ]
    ],
    "expiresAt": "2023-10-09T15:15:25.417105Z",
    "token": "eyJhbGciOiJSUzI1[...]d_jhQ",
    "companyData": {
      "branchId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
      "countryCode": "BRA"
    }
  }
}

Create Process

post

Endpoint to create a new process for liveness + 1:1 validation + behavior alert in the by Client.

Header parameters
AuthorizationstringRequired

Access-token válido.

APIKEYstringRequired

Valid APIKEY with the capabilities Liveness + 1:1 Validation + Behavior Alert.

Body
referenceProcessIdstringRequired

Identifier of the process generated during the biometric transaction creation, whose photo will be used for comparison.

Example: 80371b2a-3ac7-432e-866d-57fe37896ac6
subsidiaryIdstringOptional

The ID of the branch where the process will be created. If there is only one branch associated with the service account, this parameter is not required. If there is a separation of processes by branch, you will receive the branch IDs from the Unico team.

Example: 35d734c4-7fbb-4b2f-a1dc-7e1575514819
imageBase64stringRequired

Encrypted file generated by the SDK or base64 (if not using Liveness).

Example: /9j/4AAQSkZJR...
Responses
200
Process created successfully (User authenticated).
application/json
400
Invalid payload.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
post
POST /processes/v1 HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Content-Type: application/json
Accept: */*
Content-Length: 252

{
  "subject": {
    "code": "12345678909",
    "name": "Luke Skywalker",
    "email": "luke@unico.io",
    "phone": "551972557070"
  },
  "referenceProcessId": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "subsidiaryId": "35d734c4-7fbb-4b2f-a1dc-7e1575514819",
  "imageBase64": "/9j/4AAQSkZJR..."
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "identityFraudsters": {
    "result": "yes"
  },
  "biometryToken": {
    "result": "true"
  },
  "liveness": 1
}

Create Process

post

Endpoint to create a new process for Liveness + Identity Verification + Behavior Alert + Risk Score in the by Client.

Header parameters
AuthorizationstringRequired

Valid access token.

APIKEYstringRequired

Valid APIKEY with the capabilities Liveness + Identity Verification + Behavior Alert + Risk Score enabled.

Body
useCasestringRequired

Use case of the operation.

Example: Onboarding
subsidiaryIdstringOptional

The ID of the branch where the process will be created. If there is only one branch associated with the service account, this parameter is not required. If there is a separation of processes by branch, you will receive the branch IDs from the Unico team.

Example: 60837cd3-ed3c-4038-ad7c-0a85ad64b03a
imageBase64stringRequired

Encrypted file generated by the SDK or Base64 (if not using liveness).

Example: /9j/4AAQSkZJR...
Responses
200
Process successfully created.
application/json
400
Invalid payload.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
post
POST /processes/v1 HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Content-Type: application/json
Accept: */*
Content-Length: 215

{
  "subject": {
    "code": "12345678909",
    "name": "Luke Skywalker",
    "email": "luke@unico.io",
    "phone": "551972557070"
  },
  "useCase": "Onboarding",
  "subsidiaryId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
  "imageBase64": "/9j/4AAQSkZJR..."
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 1,
  "liveness": 1,
  "unicoId": {
    "result": "inconclusive"
  },
  "identityFraudsters": {
    "result": "yes"
  }
}

Create Process

post

Endpoint to create a new process for Liveness + Identity Verification + Behavior Alert in by Client.

Header parameters
AuthorizationstringRequired

Valid access token.

APIKEYstringRequired

Valid APIKEY with Liveness + Identity Verification + Behavior Alert capabilities enabled.

Body
useCasestringRequired

Use case for the operation.

Example: Onboarding
subsidiaryIdstringOptional

The ID of the branch where the process will be created. If there is only one branch associated with the service account, this parameter is not required. If there is a separation of processes by branch, you will receive the branch IDs from the Unico team.

Example: 60837cd3-ed3c-4038-ad7c-0a85ad64b03a
imageBase64stringRequired

Encrypted file generated by the SDK or Base64 (if not using Liveness).

Example: /9j/4AAQSkZJR...
Responses
200
Process successfully created.
application/json
400
Invalid payload.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
post
POST /processes/v1 HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Content-Type: application/json
Accept: */*
Content-Length: 215

{
  "subject": {
    "code": "12345678909",
    "name": "Luke Skywalker",
    "email": "luke@unico.io",
    "phone": "551972557070"
  },
  "useCase": "Onboarding",
  "subsidiaryId": "60837cd3-ed3c-4038-ad7c-0a85ad64b03a",
  "imageBase64": "/9j/4AAQSkZJR..."
}
{
  "id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
  "status": 3,
  "liveness": 1,
  "unicoId": {
    "result": "inconclusive"
  },
  "identityFraudsters": {
    "result": "yes"
  }
}
  • Have the iOS SDK version 11 or higher installed;

  • Have the dependency manager Cocoapods or Swift Package Manager configured.

Troubleshooting

In this section, you will find solutions to some common issues encountered during the integration of the Unico IDCloud SDK into your iOS applications


Code Obfuscation


  • The obfuscation material is intended to assist the developer in overcoming obfuscation issues in their application.

  • The client obfuscator may affect the functionality of the SDK, so it is necessary that it does not obfuscate the SDK code.

  • Unico is not responsible for obfuscation conflicts with the SDK.

Obfuscation is a process of transforming the bytecode into a form that is less readable by humans, thus making reverse engineering more difficult.

This process involves removing debugging-related information, such as variable tables, line numbers, and renaming packages, classes, and methods.

When embedding the Android SDK into the application, issues may occur.

Obfuscation via iXGuard


When obfuscation is performed using the iXGuard tool, we recommend using version 4.12.6 or higher.

Shadow at the End of Flow after Updating to Version 2.4.0


The responsibility for controlling the flow is delegated to the caller of the SDK. Therefore, if any form of shadow appears or the screen does not close after successfully completing the capture, it is recommended to implement a way to release this screen. This release may vary depending on the navigation stack implemented. For this implementation, add the appropriate release method preferably within the onSuccessSelfie delegate method. Below are some examples of releases that can be used:

- (void)onSuccessSelfie:(SelfieResult *)result {
    [self dismissViewControllerAnimated:YES completion:nil];
    // your code
} 
func onSuccessSelfie(_ result: AcessoBio.SelfieResult!) {
    navigationController?.popViewController(animated: true)
    // your code
 }

Bitcode Error in App Distribution using Xcode 16


After the official release of Xcode 16 on September 17, 2024, and its use for distributing apps on the App Store, we encountered a block when using the iOS SDK, signaling the use of bitcode in two internal dependencies when using Cocoapods as the dependency manager. These dependencies are DeviceProfiling and UnicoSdkLogger. In order to avoid blocking new releases, it is possible to apply the following steps until the issue is fully resolved in a future iOS SDK release:

  1. Open the Podfile file.

  2. Add the following lines after the post_install command (do |installer|) and before the last end:

bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    framework_path = File.join(Dir.pwd, framework_relative_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end

  framework_paths = [
    "Pods/unicocheck-ios/DeviceProfiling.xcframework/ios-arm64/DeviceProfiling.framework/DeviceProfiling",
    "Pods/unicocheck-ios/UnicoSdkLogger.xcframework/ios-arm64/UnicoSdkLogger.framework/UnicoSdkLogger"
  ]

  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end

2.1. If there is already some code, insert the following before the existing code;

2.2. If you are already manually removing bitcode, explicitly add the paths mentioned in framework_paths.

  1. If the post_install do |installer| command is not present in the Podfile, insert it as follows before the last end:

post_install do |installer|
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    framework_path = File.join(Dir.pwd, framework_relative_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end

  framework_paths = [
    "Pods/unicocheck-ios/DeviceProfiling.xcframework/ios-arm64/DeviceProfiling.framework/DeviceProfiling",
    "Pods/unicocheck-ios/UnicoSdkLogger.xcframework/ios-arm64/UnicoSdkLogger.framework/UnicoSdkLogger"
  ]

  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end

Error Handling Guide

In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Android applications



This object is returned whenever an error occurs in the iOS SDK.

Available Methods


Method Name
Description

getCode()

Method used to obtain the error code that occurred.

getDescription()

Method used to obtain the description of the error that occurred.

Below is a list of possible error codes from the iOS SDK:

Code
Description

73000

The Session was cancelled because of an unknown and unexpected error. The Unico Check SDK leverages a variety of iOS APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.

73001

Context invalid

73003

The API version needs to be 11 or newer.

73006

Unable to open camera on emulators

73100

Unable to connect to internet

73200

Could not find the unico_sdk json file

73202

Unable to load unico_sdk json file

73203

Unable to load AcessoBioConfigDataSource

73204

Unable to initialize the SDK, please configure the environment on setEnviroment method of build.

73300

Unable to get unico authentication object

73301

Unable to parse unico authentication object

73302

Could not find the unico token

73701

Could not find active liveness import

73702

Unable to initialize active liveness in production mode

73703

Unable to get active liveness session

73704

The user pressed the cancel button and did not complete the Session.

73705

The Session was not performed successfully and a FaceScan was not generated. In general, other statuses will be sent to the developer for specific unsuccess reasons.

73706

The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to not allow access by a device policy.

73707

The Session was cancelled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the background.

73708

The Session was cancelled because the device is in landscape mode. The user experience of devices in these orientations is poor and thus portrait is required.

73709

The Session was cancelled because the device is in reverse portrait mode. The user experience of devices in these orientations is poor and thus portrait is required.

73710

The Session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set by the developer.

73711

The Session was cancelled due to memory pressure.

73712

The Session was cancelled because your App is not in production and requires a network connection.

73713

The Session was cancelled because your key needs to be validated again.

73714

The Session was cancelled because the developer-configured encryption key was not valid.

73715

The Session was cancelled because not all guidance images were configured.

73716

The Session was cancelled because SDK was unable to start the camera on this device.

73717

The Session was cancelled because the user was in a locked out state.

73718

The Session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.

73719

The Session was cancelled because the user pressed the Get Ready screen subtext message. Note: This functionality is not available by default, and must be requested from FaceTec in order to enable it.

73720

The Session was not processed.

73721

The Session can't be performed: attempts limit exceeded.

73722

The Session can't be performed: face alignment timeout.

73730

Unable to initialize an active liveness session because of an unknown and unexpected license error.

73731

Unable to initialize an active liveness session because the license has expired.

73800

Could not build encrypted key


Document Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your iOS applications for document capture


This guide has been designed to help you quickly and easily implement the Android SDK. Below, you'll find the step-by-step process for the complete integration. If you wish to customize the experience further, check out the iOS Customization section.

Available Document Frames


In this camera mode, there is a capture frame to assist the user in positioning the document correctly. After positioning the document correctly, the user should click the button to capture the photo of the document.

The SDK does not perform any type of validation on what is being captured.

In this camera mode, it is possible to capture the following documents:

  • RG: Capture of the RG (separate front and back).

  • CNH: Capture of the CNH opened.

  • CNH Front: Capture of the front of the CNH.

  • CNH Back: Capture of the back of the CNH.

  • CPF: Capture of the CPF document.

  • Without Silhouette: Capture of a generic document.

Initializing the SDK


To get started with the Unico IDCloud iOS SDK, import the SDK and implement the AcessoBioManagerDelegate interface within the ViewController you wish to use.

The implementation of this class is straightforward and can be done with just a few lines of code. All you need to do is instantiate the builder by providing the relevant context and override the callback methods with the business logic of your application:

.m:
#import "ViewController.h"
#import <AcessoBio/AcessoBio.h>

@interface ViewController ()
@end

@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];   
    unicoCheck = [[AcessoBioManager alloc]initWithViewController:self];
}
   
- (void)onErrorAcessoBioManager:(ErrorBio *)error {
  // Your code
}

- (void)onSystemChangedTypeCameraTimeoutFaceInference {
  // Your code
}

- (void)onSystemClosedCameraTimeoutSession {
  // Your code
}

- (void)onUserClosedCameraManually {
  // Your code
}

@end
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate {
  var unicoCheck: AcessoBioManager!

  override func viewDidLoad() {
    super.viewDidLoad()
    
    unicoCheck = AcessoBioManager(viewController: self)
  }

  func onErrorAcessoBioManager(_ error: ErrorBio!) {
    // Your code
  }

  func onUserClosedCameraManually() {
    // Your code
  }

  func onSystemClosedCameraTimeoutSession() {
    // Your code
  }

  func onSystemChangedTypeCameraTimeoutFaceInference() {
    // Your code
  }
}   

Implementing Callback Functions


Note that, as shown in the previous example, the implementation work of the AcessoBioManagerDelegate interface is largely about configuring the callback methods. Each method is called in a specific situation based on the SDK's response.

Simply override the methods illustrated in the previous step with your application's business logic:

1

onErrorAcessoBioManager(_ error: ErrorBio!)

This method is invoked whenever an implementation error occurs while using any of the methods, such as providing an incorrect document type for the document capture functionality.

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is also invoked once the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can modify the maximum session time for your user when using the face detection feature (Selfie camera with intelligent capture). If the time limit for capturing the photo is exceeded, you can present a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked once the maximum time for detecting the user's face is reached (without detecting anything). In this case, the camera mode is automatically switched to manual capture mode (without the intelligent capture silhouette).

The maximum capture time when using face detection (Selfie camera with intelligent capture) is 13 seconds. If the user faces difficulties capturing the photo using face detection and exceeds the time limit set in the process, the capture automatically switches to manual mode, aiming to facilitate the process for the user (TimeoutToFaceInference).

All of the above methods must be implemented as indicated in your project (even if with no logic). Otherwise, the project will not compile successfully.

Implementing Delegates for Camera Events


The camera opening method (which is called in the next step) needs to know what to do when it successfully captures an image or encounters an error during the process. The "actions" to be taken are specified to the camera opening method through the configuration of delegates, which are called in success or error situations.

By configuring the delegates, you can define what happens in your app during error situations (onErrorDocument method) or success situations (onSuccessDocument method) when capturing images.

To configure the delegates, you need to implement the DocumentCameraDelegate and AcessoBioDocumentDelegate interfaces:

.h:
#import <UIKit/UIKit.h>
#import <AcessoBio/AcessoBio.h>
#import "SelfieCameraDelegate.h"

@interface ViewController: UIViewController <AcessoBioManagerDelegate, DocumentCameraDelegate, 
  AcessoBioDocumentDelegate> {
  AcessoBioManager *unicoCheck;
  // Your code from previous and next steps here
}
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate, DocumentCameraDelegate, 
  AcessoBioDocumentDelegate {    
  // Your code from previous and next steps here
}

onSucessDocument Method


When an image is successfully captured, this method is invoked and returns an object of type ResultCamera, which is used later in the REST API request.

- (void)onSuccessDocument:(DocumentResult *)result {
    NSLog(@"%@", result.base64);
} 
func onSuccessDocument(_ result: DocumentResult!) {
    // Your code
 }

The ResultCamera object returns two attributes: base64 and encrypted.

  • The base64 attribute can be used if you want to display a preview of the image in your app.

  • Both the encrypted and base64 attributes can be sent in the REST API calls of the by Client.

Método onErrorDocument


When an error occurs during image capture, this method is invoked and returns an object of type ErrorBio.

- (void)onErrorDocument:(ErrorBio *)errorBio {
    // Your code
}
func onErrorDocument(_ errorBio: ErrorBio!) {
    // Your code
 }

Learn more about the ErrorBio types in the error handling section of the SDK.

Preparing and Opening the Camera


To open the camera, it is necessary to prepare it using the method prepareDocumentCamera. This method takes as a parameter the implementation of the DocumentCameraDelegate class and the JSON with the credentials generated in the previous step.

.h:
#import <UIKit/UIKit.h>
#import <AcessoBio/AcessoBio.h>
#import "SelfieCameraDelegate.h"

@interface ViewController: UIViewController < AcessoBioManagerDelegate,
DocumentCameraDelegate, AcessoBioDocumentDelegate> {
    AcessoBioManager *unicoCheck;
}

.m:
- (IBAction)openCamera:(UIButton *)sender {
    [[unicoCheck build] prepareDocumentCamera:self config:[YourUnicoConfigClass new]];
}
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate, 
DocumentCameraDelegate, AcessoBioDocumentDelegate {
    @IBAction func openCamera(_ sender: Any) {
        unicoCheck.build().prepareDocumentCamera(self, config: YourUnicoConfigClass())
    }
}

When the camera is ready, the event onCameraReadyDocument is triggered, which receives as a parameter an object of type AcessoBioCameraOpenerDelegate.

You should override this method, opening the camera with the object received through the openDocument() method, receiving the document type parameters to be captured, which are:

Parameter
Description

DocumentEnums.CPF

Capture the front of the CPF

DocumentEnums.CNH

Capture the open CNH

DocumentEnums.cnhFrente

Capture the front of the CNH

DocumentEnums.cnhVerso

Capture the back of the CNH

DocumentEnums.RG

Capture the open RG

DocumentEnums.rgFrente

Capture the front of the RG

DocumentEnums.rgVerso

Capture the back of the RGo RG

DocumentEnums.none

Capture any other document

If you need to capture a document for which we don't have a specific frame (e.g., RNE, among others), use the DocumentEnums.none frame, which will provide a generic, rectangular frame that can be used to guide any capture.

The delegates implemented above (referred to here as Self):

- (void)onCameraReadyDocument:(id)cameraOpener {
    [cameraOpener openDocument:DocumentCNH delegate:self];
}

- (void)onCameraFailedDocument:(ErrorPrepare *)message {
  // Your code
}
func onCameraReadyDocument(_ cameraOpener: AcessoBioCameraOpenerDelegate!) {
    cameraOpener.openDocument(DocumentEnums.CNH, delegate: self)
}
 
func onCameraFailedDocument(_ message: ErrorPrepare!) {
  // Your code
}

The ErrorPrepare type is an extension of ErrorBio, thus containing all its properties. Learn more about the ErrorBio type in the SDK error handling section.

If an error occurs while preparing the camera, the onCameraFailedDocument event is triggered. You should implement this method according to the business logic of your app.

In case of success, the onSuccessDocument event is triggered, as explained in the section above.

Making a POST Request to the Client API



iOS Customization

In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Android applications


The Android SDK allows for some customizations to be made. Below are all the possible customizations for this SDK.

Customize Language


It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes, which contains the following values:

  • LocaleTypes.PT_BR: for Portuguese(Brazil);

  • LocaleTypes.ES_MX: for Spanish(Mexico);

  • LocaleTypes.ES_ES: for Spanish(Spain);

  • LocaleTypes.EN_US: for English(USA).

See how to implement it in the example below:

[unicoCheck setLocale:EN_US];
unicoCheck.setLocale(.EN_US);
  • A remote activation may be required to use this feature. If you wish to use it, please notify your project manager or Unico support.

  • If not configured, by default the SDK uses Portuguese as the primary language.

Customize Capture Experience


This is an optional step, but highly recommended for the capture process to have your company's visual identity.

It is possible to customize some objects of the frame according to the camera mode used, through the setTheme() method.

The supported types for color representation are Color Resource or String containing the hexadecimal color code. For example: R.color.red or #FF0000.

All methods are available below:

Method
Description

getColorSilhouetteSuccess()

Method used to customize the success color of the silhouette.

getColorSilhouetteError()

Method used to customize the error color of the silhouette.

getColorBackground()

Method used to customize the background color of the silhouette.

getColorBoxMessage()

Method used to customize the background color of the message.

getColorTextMessage()

Method used to customize the text color of the message.

getColorTextPopupError()

Method used to customize the text and icon color of the error popup.

getColorBackgroundPopupError()

Method used to customize the background color of the error popup.

getColorBackgroundButtonPopupError()

Method used to customize the background color of the popup button.

getColorTextButtonPopupError()

Method used to customize the text color of the popup button.

getColorBackgroundTakePictureButton()

Method used to customize the background color of the manual photo capture button.

getColorIconTakePictureButton()

Method used to customize the icon color of the manual photo capture button.

getColorBackgroundBottomDocument()

Method used to customize the background color of the document capture box.

getColorTextBottomDocument()

Method used to customize the text color of the document capture box.

getImageIconPopupError()

Method used to customize the icon of the error popup, displayed when the face is incorrectly positioned within the capture frame.

getProgressBarColor() (opcional)

Optional method used to customize the loading icon color for the Liveness camera with interaction. If not implemented, getColorBoxMessage() will be used.

getCancelButtonIconColor() (opcional)

Optional method used to customize the cancel icon color for the Liveness camera with interaction. If not implemented, getColorBackgroundTakePictureButton() will be used.

Here are some examples of how you can use the above methods in your project:

.h:
#import "AcessoBioThemeDelegate.h"

@interface ViewController : UIViewController  {

@end

.m:
#import "ViewController.h"
#import <AcessoBio/AcessoBio.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    unicoCheck = [[AcessoBioManager alloc]initWithViewController:self];
}

- (id)getColorBackground {
    code
}

- (id)getColorBackgroundBottomDocument {
    code
}

- (id)getColorBackgroundButtonPopupError {
    code
}

- (id)getColorBackgroundPopupError {
    code
}

- (id)getColorBackgroundTakePictureButton {
    code
}

- (id)getColorBoxMessage {
    code
}

- (id)getColorIconTakePictureButton {
    code
}

- (id)getColorSilhouetteError {
    code
}

- (id)getColorSilhouetteSuccess {
    code
}

- (id)getColorTextBottomDocument {
    code
}

- (id)getColorTextButtonPopupError {
    code
}

- (id)getColorTextMessage {
    code
}

- (id)getColorTextPopupError {
    code
}

- (id) getProgressBarColor {
    code
}

- (id) getCancelButtonIconColor {
    code
}

@end
import UIKit
import AcessoBio

class ViewController: UIViewController, AcessoBioManagerDelegate, AcessoBioThemeDelegate {

    var unicoCheck: AcessoBioManager!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        unicoCheck = AcessoBioManager(viewController: self)
        unicoCheck.setTheme(self)
    }
 

    func getColorBackground() -> Any! {
        code
    }

    func getColorBoxMessage() -> Any! {
        code
    }

    func getColorTextMessage() -> Any! {
        code
    }

    func getColorBackgroundPopupError() -> Any! {
        code
    }

    func getColorTextPopupError() -> Any! {
        code
    }

    func getColorBackgroundButtonPopupError() -> Any! {
        code
    }

    func getColorTextButtonPopupError() -> Any! {
        code
    }

    func getColorBackgroundTakePictureButton() -> Any! {
        code
    }

    func getColorIconTakePictureButton() -> Any! {
        code
    }

    func getColorBackgroundBottomDocument() -> Any! {
        code
    }

    func getColorTextBottomDocument() -> Any! {
        code
    }

    func getColorSilhouetteSuccess() -> Any! {
        code
    }

    func getColorSilhouetteError() -> Any! {
        code
    } 

    func getProgressBarColor() -> Any! {
        code
    }

    func getCancelButtonIconColor() -> Any! {
        code
    }
} 

Release notes

In this section, you will find all the updates for the Unico IDCloud iOS SDK


Keep your iOS SDK always up to date with the latest available version. Semantic versioning is used to number the versions. For more information, please refer to the article Overview.


Version 2.16.11 - 25/03/2025

pod 'unicocheck-ios', '2.16.11'
  • SDK Update and Liveness Server Interaction;

  • Accessibility improvements.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Version 2.16.10 - 06/03/2025

pod 'unicocheck-ios', '2.16.10'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Version 2.16.9 - 05/02/2025

pod 'unicocheck-ios', '2.16.9'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Version 2.16.8 - 17/01/2025

pod 'unicocheck-ios', '2.16.8'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Version 2.16.7 - 14/01/2025

pod 'unicocheck-ios', '2.16.7'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Version 2.16.6 - 19/12/2024

pod 'unicocheck-ios', '2.16.6'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


pod 'unicocheck-ios', '2.16.5'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


pod 'unicocheck-ios', '2.16.4'
  • SDK Update and Liveness Server Interaction.

Starting with Xcode 15, Apple has dropped support for iOS 11. Unico will discontinue support for iOS 11 in the Unico Check iOS SDK in a future version.


Flutter Customization

In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Flutter applications


The Flutter SDK allows for some customizations to be made. Below are all the possible customizations for this SDK.

Customize Language


It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes, which contains the following values:

  • LocaleTypes.PT_BR: for Portuguese(Brazil);

  • LocaleTypes.ES_MX: for Spanish(Mexico);

  • LocaleTypes.ES_ES: for Spanish(Spain);

  • LocaleTypes.EN_US: for English(USA).

See how to implement it in the example below:

unicoCheck.setLocale(LocaleTypes.EN_US);
  • A remote activation may be required to use it. If you wish to use it, please notify your project manager or Unico support.

  • If it is not configured, by default, the SDK uses Portuguese as the primary language.

Customize Capture Experience


This is an optional step, but highly recommended to ensure that the capture process aligns with your company's visual identity.

It is possible to customize some objects of the frame according to the camera mode used, through the setTheme() method.

The supported types for color representation are either a Color Resource or a String containing the hexadecimal color code. For example: R.color.red or #FF0000.

All the methods are available below:

Method

getColorSilhouetteError()

getColorSilhouetteNeutral()

getColorBackground()

getColorBoxMessage()

getColorTextMessage()

getColorBackgroundPopupError()

getColorBackgroundButtonPopupErrorgetColorTextPopupError()

getColorBackgroundButtonPopupError()

getColorTextButtonPopupError()

getColorBackgroundTakePictureButton()

getColorIconTakePictureButton()

getColorBackgroundBottomDocument()

getColorTextBottomDocument()

getColorProgressBar()

getColorCancelButtonIcon()

In the Android implementation, the customization of the colorCancelButtonIcon should be done by adding the desired color in the colors.xml resource file.

<resources>
    <color name="unico_color_button_cancel">YOUR COLOR</color>
</resources>

Document Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your Flutter applications for document capture


Available Document Frames


In this camera mode, there is a capture frame to assist the user in positioning the document correctly. Once the document is properly positioned, the user must click the button to take a photo of the document.

The SDK does not perform any validation of what is being captured.

In this camera mode, it is possible to capture the following documents:

  • CPF: Capture the front of the CPF;

  • CNH: Capture the open CNH;

  • CNH Front: Capture the front of the CNH;

  • CNH Back: Capture the back of the CNH;

  • RG Front: Capture the front of the RG;

  • RG Back: Capture the back of the RG;

  • Others: Capture any other document.

Initializing the SDK


To get started, create an instance of the builder (generated through the UnicoCheckBuilder interface), providing the context and the implementation of the UnicoListener class as parameters.

The implementation of this class is quite simple and can be done with just a few lines of code. All you need to do is override the callback methods with your application's business logic.

class _MyHomePageState extends State<MyHomePage> implements UnicoListener {

    late UnicoCheckBuilder _unicoCheck;

    /// Unico callbacks
      @override
      void onErrorUnico(UnicoError error) {}

      @override
      void onUserClosedCameraManually() {}

      @override
      void onSystemChangedTypeCameraTimeoutFaceInference() {}

      @override
      void onSystemClosedCameraTimeoutSession() {}

      /// Document callbacks
      @override
      void onSuccessDocument(ResultCamera resultCamera) { }

      @override
      void onErrorDocument(UnicoError error) { }

}

Implementing the callback functions


Note that, as in the previous example, the implementation work of the UnicoListener class is largely about configuring the callback methods. Each method is called in a specific situation based on the SDK's response.

Override the methods exemplified above with your application’s business logic:

1

onErrorUnico(UnicoError error)

When invoked, the method receives a parameter of type UnicoError, which contains details about the error. Learn more about the UnicoError type in the SDK's error handling section.

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is invoked as soon as the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can change the maximum session time for your user by using the face detection feature (Selfie camera with smart capture). If the user exceeds the time set in your process to capture the photo, you can display a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked as soon as the maximum time for detecting a user's face is reached (without detecting anything). In this case, the camera mode is automatically switched to manual capture mode (without the smart capture silhouette).

The maximum capture time when using face detection (Selfie camera with smart capture) is 13 seconds. If the user encounters difficulty capturing the photo via face detection and exceeds the time set in your process, the capture mode is automatically switched to manual, aiming to make the action easier for the user (TimeoutToFaceInference)..

All the methods above must be created as indicated in your project (even if without any logic). Otherwise, the project will not compile successfully.

Implementing Listeners for Camera Events


The implementation of these listener methods must be done through an instance of the iAcessoBioSelfie class.

The camera opening method needs to know what to do when it successfully captures an image or encounters an error during the process. "What to do" is communicated to the camera opening method by implementing listeners that are called in cases of success or error.

Through the implementation of the listeners, you can specify what happens in your app in case of error (onErrorDocument method) or success (onSuccessDocument method) when capturing images.

onSucessDocument Method


When successfully capturing an image, this method is invoked and returns an object of type ResultCamera, which is later used in the REST API requests:

public void onSuccessDocument(ResultCamera resultCamera) { }

The ResultCamera object returns 2 attributes: base64 and encrypted:

  • The base64 attribute can be used if you want to display a preview of the image in your app;

  • Both the encrypted and base64 attributes can be sent in the REST API calls to by Client.

onErrorDocument Method


If an error occurs during the image capture, this method is invoked and returns an object of type UnicoError:

public void onErrorDocument(UnicoError error) { }

Learn more about the types of ErrorBio in the SDK's error handling section.

Preparing and Opening the Camera


To open the camera, the openCameraDocument() method is used. This method is provided through the object generated with an instance of the UnicoCheck class.

This method takes the following parameters:

  • A JSON file with the credentials, generated in the credential setup step;

  • The listeners configured above;

  • The type of document to be captured, which can be:

Parameter
Description

DocumentCameraTypes.CPF

Capture the front of the CPF

DocumentCameraTypes.CNH

Capture the open CNH

DocumentCameraTypes.CNH_FRENTE

Capture the front of the CNH

DocumentCameraTypes.CNH_VERSO

Capture the back of the CNH

DocumentCameraTypes.RG_FRENTE

Capture the front of the RG

DocumentCameraTypes.RG_VERSO

Capture the back of the RG RG

DocumentCameraTypes.OUTROS("descrição")

Capture any other document

If you need to capture a document that doesn't have a specific frame (e.g., RNE, among others), use the frame DocumentCameraTypes.OUTROS("description"), which will provide a generic, rectangular frame that can be used to guide any capture.

Example using the open CNH:

 _unicoCheck.build().openCameraDocument(
        jsonFileName: androidJsonFileName,
        documentType: DocumentType.CNH,
        listener: this);

Making a POST Request to the Client API



Error Handling Guide

In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Android applications



This object is returned whenever an error occurs in the Flutter SDK.

Available Methods


Method Name
Description

getCode()

Method used to obtain the error code that occurred.

getDescription()

Method used to obtain the description of the error that occurred.

Below is a list of possible error codes from the Flutter SDK:

Code
Description

73001

Context invalid

73002

Did not grant permission to open camera

73003

The lest API is 21(LOLLIPOP)

73004

Could not find implementation interface callback iAcessoBioSelfie

73005

Could not find implementation interface callback iAcessoBioDocument

73006

Unable to open camera on emulators

73100

Unable to connect to internet

73200

Please inform the json file name

73202

Unable to parse json file

73300

Unable to get unico authentication object

73301

Unable to parse object

73302

Could not find the unico token

73303

Current host is not registered

73400

Could not initialize camera

73500

Unable to get session token, service response error

73501

Unable to parce object

73502

Could not get session token

73701

Could not find active liveness import

73702

Unable to initialize active liveness in production mode

73703

Unable to get active liveness session

73704

The user pressed the cancel button and did not complete the Session.

73705

The Session was not performed successfully and a FaceScan was not generated. In general, other statuses will be sent to the

73706

The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to

73707

The Session was cancelled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the

73708

The Session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor

73709

The Session was cancelled because device is in reverse portrait mode. The user experience of devices in these orientations is

73710

The Session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set

73712

The Session was cancelled due to memory pressure.

73712

The Session was cancelled because your App is not in production and requires a network connection.

73713

The Session was cancelled because your key needs to be validated again.

73714

The Session was cancelled because the developer-configured encryption key was not valid.

73715

The Session was cancelled because not all guidance images were configured.

73716

The Session was cancelled because SDK was unable to start the camera on this device.

73717

The Session was cancelled because the user was in a locked out state.

73718

The Session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera,

73719

The Session cancelled because user pressed the Get Ready screen subtext message. Note: This functionality is not available by

73800

Could not build encrypted key


Selfie Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Flutter applications for selfie capture


Initializing the SDK


To get started, create an instance of the builder (generated through the UnicoCheckBuilder interface), providing the context and environment as parameters, along with the implementation of the UnicoListener class.

The implementation of this class is quite simple and can be done with just a few lines of code. All you need to do is override the callback methods with your application's business logic.

class _MyHomePageState extends State<MyHomePage> implements UnicoListener {

    late UnicoCheckBuilder _unicoCheck;

    
      @override
      void onErrorUnico(UnicoError error) {}

      @override
      void onUserClosedCameraManually() {}

      @override
      void onSystemChangedTypeCameraTimeoutFaceInference() {}

      @override
      void onSystemClosedCameraTimeoutSession() {}
}

Environment configuration


Configure the environment that will be used to run the SDK. Use the enumerated environment that contains the following enumerates:

  • UnicoEnvironment.PROD: for production environment;

  • UnicoEnvironment.UAT: for approval environment.

See how to implement it in the example below:

 _unicoCheck.setEnvironment(unicoEnvironment: UnicoEnvironment.UAT);

Implementing the Callback functions


Note that, as shown in the previous example, the implementation of the UnicoListener class mostly involves configuring the callback methods. Each method will be called in a specific situation based on the SDK's return.

Simply override the methods demonstrated in the previous step with your application's business logic:

1

onErrorUnico(UnicoError error)

2

onUserClosedCameraManually()

This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.

3

onSystemClosedCameraTimeoutSession()

This method is invoked as soon as the maximum session time is reached (without capturing any image).

It can be configured in the builder through the setTimeoutSession method. This method should receive the maximum session time in seconds. You can change the maximum session time for your user by using the face detection feature (Selfie camera with smart capture). If the user exceeds the time defined in your process to capture the photo, you can display a customizable message or instruction to the user. The default value is 40 seconds, and the minimum value is also 40 seconds.

4

onSystemChangedTypeCameraTimeoutFaceInference()

This method is invoked as soon as the maximum time for detecting a user's face is reached (without detecting anything). In this case, the camera mode is automatically changed to manual capture mode (without the smart capture silhouette).

The maximum capture time when using face detection (Selfie camera with smart capture) is 13 seconds. If the user has difficulty capturing the photo via face detection and exceeds the time set in your process, the capture mode automatically switches to manual to make the process easier for the user (TimeoutToFaceInference).

All of the above methods must be created as indicated in your project (even if with no logic). Otherwise, the project will not compile successfully.

Configuring Camera Mode


The SDK has intelligent framing and automatic capture configured and enabled by default. As a result, you should configure the camera mode in your builder as follows:

UnicoCheckCameraOpener _opener = new UnicoCheck (this)
    .setAutoCapture(autoCapture: true)
    .setSmartFrame(smartFrame: true)
    .build();

The false/true values for the methods above do not alter the capture experience; they are only used for the internal logic of the SDK's functionality.

Implementing Listeners for Camera Events


The implementation of these listener methods must be done through an instance of the UnicoSelfie class.

The camera opening method needs to know what to do when it successfully captures an image or encounters an error during the process. "What to do" is informed to the camera opening method by implementing listeners, which are called in cases of success or error.

Through the implementation of these listeners, you can specify what happens in your app in case of error (onErrorSelfie method) or success (onSuccessSelfie method) when capturing images.

onSucessSelfie Method


When successfully capturing an image, this method is invoked and returns an object of type ResultCamera, which is later used in the REST API requests:

@override
void onSuccessSelfie(ResultCamera result) { }

The ResultCamera object returns 2 attributes: base64 and encrypted:

  • The base64 attribute can be used if you want to display a preview of the image in your app.

  • The encrypted attribute must be sent in the REST API calls by Client.

  • The encrypted attribute is strictly intended for sending the image through the by Client APIs. It should not be opened or serialized, as its characteristics can be altered without prior notice. Its use should be exclusive for interactions with the APIs to ensure data integrity and security. Unico is not responsible for any damages resulting from this practice, as modifications can occur unexpectedly.

  • The base64/encrypted files may vary in size depending on several factors, including the quality of the devices and the photos generated by them, as well as Unico's business rules. To avoid issues in your application, do not limit the size of the string generated by the SDK for these files in your programming logic or infrastructure.

onErrorSelfie Method


If an error occurs during the image capture, this method is invoked and returns an object of type UnicoError:

@override
void onErrorSelfie(UnicoError error) { }

Learn more about the ErrorBio types in the SDK's error handling section.

Preparing and Opening the Camera


The openCameraSelfie method is used to open the camera. This method takes as parameters the implementation of the UnicoSelfie class and the JSON with the credentials, generated in the previous step.

The following example illustrates the steps for configuring the listeners and opening the camera:

_opener.openCameraSelfie(jsonFileName: androidJsonFileName, listener: this)

Making a POST Request to the Client API


For security reasons, the interval between the generation of the encrypted and its sending via one of the available flows must be a maximum of 10 minutes. Submissions made beyond this period will be automatically rejected by the API.


Troubleshooting

In this section, you will find solutions to some common issues encountered during the integration of the Unico IDCloud SDK into your Flutter applications


Code Obfuscation


The obfuscation material is intended to assist developers in overcoming obfuscation issues in their app.

The client's obfuscator may affect the functionality of the SDK, and it is necessary to ensure that it does not obfuscate the SDK code.

Unico disclaims any responsibility for obfuscation conflicts with the SDK.

Obfuscation is a process of transforming bytecode into a form that is less readable by humans, thus making reverse engineering more difficult.

This process involves removing debugging-related information such as variable tables, line numbers, and renaming packages, classes, and methods.

When embedding the Android SDK into the application, failures may occur.

Obfuscation via DexGuard


When obfuscation is performed using DexGuard, if a failure occurs, use the following rules:

-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.facetec.sdk.** { *; }
-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }

Obfuscation via ProGuard


When obfuscation is performed using ProGuard, if a failure occurs, use the following rules:

-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.facetec.sdk.** { *; }
-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }

Bitcode Error in App Distribution using Xcode 16


After the official release of Xcode 16 on September 17, 2024, and its use for app distribution on the AppStore, we noticed a block when using the iOS SDK that signaled the use of Bitcode in two internal dependencies when using Cocoapods as the dependency manager. These dependencies are DeviceProfiling and UnicoSdkLogger. To avoid blocking new releases, you can follow the steps below until a permanent fix is included in a future iOS SDK release:

  1. Open the Podfile.

  2. Insert the following lines after the post_install do |installer| command and before the last end:

bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    framework_path = File.join(Dir.pwd, framework_relative_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end

  framework_paths = [
    "Pods/unicocheck-ios/DeviceProfiling.xcframework/ios-arm64/DeviceProfiling.framework/DeviceProfiling",
    "Pods/unicocheck-ios/UnicoSdkLogger.xcframework/ios-arm64/UnicoSdkLogger.framework/UnicoSdkLogger"
  ]

  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end

2.1. If there is already some code, insert it before the existing section;

2.2. If Bitcode has already been removed manually, add the paths explicitly mentioned in framework_paths.;

  1. If the post_install do |installer| command is not present in the Podfile, insert it as follows before the last end:

post_install do |installer|
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    framework_path = File.join(Dir.pwd, framework_relative_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end

  framework_paths = [
    "Pods/unicocheck-ios/DeviceProfiling.xcframework/ios-arm64/DeviceProfiling.framework/DeviceProfiling",
    "Pods/unicocheck-ios/UnicoSdkLogger.xcframework/ios-arm64/UnicoSdkLogger.framework/UnicoSdkLogger"
  ]

  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end

Installation Guide

In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your Web applications


Compatible Browsers


The capture frame provided through the SDK is compatible with the following combinations of browsers and operating systems:

Operational System
Chrome
Firefox
Safari
Samsung Internet
Opera
Edge

Windows (desktop)

N/A

N/A

Android

N/A

iOS

N/A

MacOS (desktop)

N/A

In general, the SDK supports WebRTC and the more recent versions of the browsers listed above. For compatibility and security reasons, functionality on very old versions of these browsers is not guaranteed.

The capture component provided through the Flutter SDK supports versions equal to or higher for the following technologies:

  • Android: 5.0 (API 21);

  • iOS: 11.

Webview Operation


It is a system component that allows Android or iOS applications to display web content directly within the app, based on the same code project. It is responsible for navigation on websites and web content within the apps.

Preconditions


  • It is necessary to have implemented the Web SDK in an application that contains a secure domain with the https protocol.

Compatibility with Operating Systems


Android:


The Web SDK is compatible with webviews running on Android 8 (API 26) or higher.

For the SDK to work correctly, it is necessary to add some permissions and configurations to the AndroidManifest file, which are as follows:

AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.webkit.PermissionRequest" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera2.full" />
<uses-feature android:name="android.hardware.camera2.autofocus" />

iOS


The Web SDK is compatible with webviews running on iOS 13 or higher.

For the SDK to function correctly, it is necessary to add some permissions and configurations to the info.plist file, which are as follows:

info.plist
<key>NSCameraUsageDescription</key>
<string>Camera usage description</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Mensagem da cliente</string>

Compatibility with Hybrid Frameworks


The component has been approved only for native layers. To be used in hybrid frameworks (Flutter or React Native), it is necessary to implement it in the native layer of Android and/or iOS.

When running, the SDK will request permission to open the camera for the webview, which in turn will request the same permission from the native application. It is mandatory that your native application has the necessary permissions set in the configuration files.

Our support is limited to applications developed directly on native Android and iOS platforms, using their respective native modules. Currently, we do not offer support for applications developed in hybrid frameworks such as React Native, Ionic, or other cross-platform development technologies.

Compatibility with social media webviews


The component has been approved on the Instagram and Facebook social media platforms in Liveness mode without interaction. The Liveness mode with interaction is not compatible with webviews in social media apps.

Installing the Web SDK


To implement the Unico IDCloud Android SDK into your Android application, follow the step-by-step guide below:

1

Content Security Policy (CSP) Setting

The Web SDK uses Web Workers to enhance security and performance. Therefore, it is necessary to add the following configurations to your Content Security Policy (CSP):

<meta
  http-equiv="Content-Security-Policy"
  content="
      script-src 'self' 'unsafe-eval' *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app; 
      worker-src 'self' blob:; 
      child-src 'self' blob:;
            style-src 'self' 'unsafe-inline' *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app;
            font-src 'self' https://fonts.gstatic.com *.acesso.io *.unico.run *.unico.io *.unico.app;
            img-src 'self' data: blob: *.acesso.io *.unico.run *.unico.io *.unico.app;
            media-src 'self' data: *.acesso.io *.unico.run *.unico.io *.unico.app;
      script-src-elem 'self' 'unsafe-inline' blob: *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app"
/>

If your application has a CSP, this configuration is mandatory to ensure the correct functioning of the SDK.

2

Obtaining Credentials

  • Contact the CSs and/or Onboarding team.

  • Request the SDK Key by providing the identifiers of your applications. Bundle Identifier for iOS, PackageID for Android, and Host for WEB.

  • The identifiers of your applications will be linked to the SDK Key by the Unico team.

  • You will receive your SDK Key to implement the UnicoConfig.

3

Embedding the Credentials in Your Project

  • Implement the UnicoConfig class in your class:

import { UnicoConfig } from "unico-webframe"

const config = new UnicoConfig()
  .setHostname("<YOUR_HOSTNAME>")
  .setHostKey("<YOUR_HOST_KEY>");

Depracated Method:

import { UnicoConfig } from "unico-webframe"

const config = new UnicoConfig();
  .setProjectNumber("<YOUR_PROJECT_NUMBER>");
  .setProjectId("<YOUR_PROJECT_ID>");
  .setMobileSdkAppId("<YOUR_MOBILE_SDK_APP_ID>");
  .setHostname("<YOUR_HOSTNAME>");
  .setHostInfo("<YOUR_HOST_INFO>");
  .setHostKey("<YOUR_HOST_KEY>");

4

Embedding Other Files in Your Project

The table below lists additional resource files available for inclusion in your project. You should download them and include them in your project to perform Liveness capture:

Release do SDK
Release from FaceTec

3.18.10

3.18.9

3.18.8

3.18.7

3.18.6

3.18.5

3.18.4

3.18.0 -> 3.18.3

3.16.4 -> 3.17.0

3.16.3

3.16.2

3.14.1 -> 3.16.1

3.11.1 -> 3.14.0

3.10.2 -> 3.11.0

3.10.1

3.9.1 -> 3.10.0

3.9.0

3.8.3

3.8.2

3.8.0 -> 3.8.1

3.7.1 -> 3.7.2

3.6.5 -> 3.7.0

3.6.3 -> 3.6.4

3.6.1 -> 3.6.2

3.5.4 -> 3.6.0

3.5.3

3.5.0 -> 3.5.2

5

Download the AI files for the SDK

All additional files must be in a public location and visible to the Web within your project.

6

Installation

The Web SDK is provided through an npm package or CDN. To install it, follow the steps below according to your preference:

Installation via NPM package

npm install unico-webframe

Or via yarn, with the command below:

yarn add unico-webframe

Installation via CDN

To install the SDK in your project through the CDN, simply download the file below and import it into your project.

7

Importing

After installing the SDK, simply import it correctly into your project.

If you installed the package via npm:

import { UnicoCheckBuilder, SelfieCameraTypes, UnicoThemeBuilder, DocumentCameraTypes, UnicoConfig, LocaleTypes } from 'unico-webframe'

If you installed the package via cdn:

import { UnicoCheckBuilder, SelfieCameraTypes, UnicoThemeBuilder, DocumentCameraTypes, UnicoConfig, LocaleTypes } from 'UnicoCheckBuilder.min.js'


Selfie Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Web applications for selfie capture


Initializing the SDK


To get started, follow these 3 simple steps in your project:

Instantiate a new Builder:

const unicoCameraBuilder = new UnicoCheckBuilder();

Specify the path of the additional files (if added to your project):

unicoCameraBuilder.setResourceDirectory("/resources");

Specify the path of the AI model files, if using the Intelligent Camera feature.

unicoCameraBuilder.setModelsPath("https://meusite.com.br/models");

Environment Configuration


If not configured, by default, the Web SDK uses the production environment.

It is possible to configure the environment to be used when running the SDK. Use the enumerated SDKEnvironmentTypes, which contains the following enumerations:

  • SDKEnvironmentTypes.PROD: for the Production environment;

  • SDKEnvironmentTypes.UAT: for the Staging environment.

Here is an example of how to implement it:

import {
  ...
  UnicoCheckBuilder,
  SDKEnvironmentTypes
  ...
} from "unico-webframe"

unicoCameraBuilder.setEnvironment(SDKEnvironmentTypes.UAT);

Implementing the Callback Functions


One of the objects that should be passed as a parameter to the method responsible for rendering the capture frame is the callback object. This object should contain callback functions for success and error cases, as exemplified below.

  const callback = {
    on: {
      success: (obj) => {
        console.log(obj.base64);
        console.log(obj.encrypted);        
      },
      error: (error) => {
        console.error(error)
        //confira na aba "Referências" sobre os erros possíveis
      }
    }
  };

This object is mandatory, and if it is not correctly implemented (covering all success or error events), it will generate an exception, which, if not handled, will be displayed in the user's console.

  • The encrypted attribute is strictly intended for sending the image through the by Client APIs. This attribute should not be opened or serialized, as its characteristics may be altered without prior notice. Its use should be exclusive in interactions with the APIs to ensure the integrity and security of the data. Unico is not responsible for any damage resulting from this practice, as modifications may occur unexpectedly.

  • The base64/encrypted files may vary in size depending on several variables, including the quality of the devices and the photos generated by them, and Unico's business rules. To avoid issues in your application, do not limit the size of the string generated by the SDK for these files in your programming logic or infrastructure.

Configure and Start


To start the camera with the settings made so far, you need to create an instance of the builder using the build() method.

const unicoCamera = unicoCameraBuilder.build();

Then, with the camera "assembled", you need to configure the camera's capture mode.

The camera preparation will be done using the prepareSelfieCamera() method, provided by the builder. This method takes 2 parameters:

  • The desired camera mode, which can be one of the following:

    • SelfieCameraTypes.NORMAL for the normal camera mode;

    • SelfieCameraTypes.SMART for the smart camera mode.

This method returns a promise, which, when resolved, returns an object used to effectively open the camera via the open method. The open method takes as parameters the callback functions configured in the previous step.

To optimize camera startup, you can separate the calls to the methods prepareSelfieCamera() and open().

If you wish to use automatic capture, pass the parameter Unico.SelfieCameraTypes.SMART to the prepareSelfieCamera method.

For smart capture, the computer vision models should also be loaded through the setModelsPath method, as explained in the first step of this guide.

Using the UnicoConfig class:

const config = new UnicoConfig()
  .setHostname("<YOUR_HOSTNAME>")
  .setHostKey("<YOUR_HOST_KEY>");

  unicoCamera.prepareSelfieCamera(
    config, 
    SelfieCameraTypes.SMART
  ).then(cameraOpener => {
    cameraOpener.open(callback);
  }).catch(error => {
    console.error(error);
    // confira na aba "Referências" sobre os erros possíveis
  });

Configure Capture Mode in iFrames


It is possible to use the Web SDK with embedded Interactive Liveness in an iFrame. To do this, you need to implement a process similar to the previous section when preparing the camera.

The camera preparation will be done through the method prepareSelfieCameraForIFrame(), also provided by the builder. This method takes the same parameters as prepareSelfieCamera():

const unicoCamera = unicoCameraBuilder.build();

const config = new UnicoConfig()
  .setHostname("<YOUR_HOSTNAME>")
  .setHostKey("<YOUR_HOST_KEY>");

  unicoCamera.prepareSelfieCameraForIFrame(
    config, 
    SelfieCameraTypes.SMART
  ).then(cameraOpener => {
    cameraOpener.open(callback);
  }).catch(error => {
    console.error(error);
    // confira na aba "Referências" sobre os erros possíveis
  });

TThe method prepareSelfieCameraForIFrame() only works if the implementation is inside an iFrame. Using it outside of an iFrame will result in error 73724. Similarly, using the method prepareSelfieCamera() inside an iFrame will also result in error 73724.

Implementing the iFrame Element


For the capture to work correctly, it is necessary to implement the <iframe> element as shown in the example below:

<iframe allow="fullscreen;camera;geolocation" allowFullScreen src="your_app_url"></iframe>

Fullscreen Behavior

To perform the capture, it is required to be in full-screen mode in the browser so that the SDK can resize automatically. Therefore, when performing the capture, the SDK will display a screen requesting that the frame be opened in full-screen mode. See the following example:

After allowing fullscreen usage, the capture frame will open normally:

Apple restricts the use of full-screen APIs specifically on iPhones (iPads are acceptable). Therefore, for captures on iPhones, it is necessary to manually configure the positioning of the iFrame.

Making a POST Request to the Client API


For security reasons, the interval between generating the encrypted data and sending it via one of the available flows should be no more than 10 minutes. Submissions made beyond this period will be automatically rejected by the API.


Accessibility

In this section, you will find tips and information about accessibility.

SDK Components


The SDK implements components prepared with HTML attributes for accessibility, such as aria-label, tabindex, role, among others, which enable keyboard navigation between elements, activate audio guidance, and are used by screen reader software.

Best Practices


When integrating the Web SDK into a page, there may be other interactive elements on the page that are not visible during the camera opening and image capture flow. These elements may end up causing conflicts with the information in the capture flow, disrupting the user experience. Therefore, it is important to remove or deactivate interaction with other elements while the capture is being performed.

This can be done in several ways, depending on the existing elements and frameworks used on the page. Below is an example using the aria-hidden attribute:

// page html
// <div id="main-content">
//  <header>...</header>
//  <button id="my-button">Interactive Button</click>
//  <footer>...</footer>
// </div>


const unicoSdk = new UnicoCheckBuilder().build();

unicoSdk
  .prepareSelfieCamera(...)
  .then((cameraOpener) => {
    const pageElement = document.getElementById('main-content');
    pageElement.setAttribute('aria-hidden', true);
    
    cameraOpener.open({
      on: {
        success: (obj) => {
          pageElement.setAttribute('aria-hidden', false);
        },
        error: (error) => {
          pageElement.setAttribute('aria-hidden', false);
        },
      },
    });
  });

aria-hidden

It is important to use this attribute with caution, as it can harm the accessibility of elements on the page if applied incorrectly or not removed when the capture flow ends.

References


Web Customization

In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Web applications


The Web SDK allows for some customizations to be made. Below are all the possible customizations for this SDK.

Customize Language


It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes, which contains the following values:

  • LocaleTypes.PT_BR: for Portuguese(Brazil);

  • LocaleTypes.ES_MX: for Spanish(Mexico);

  • LocaleTypes.ES_ES: for Spanish(Spain);

  • LocaleTypes.EN_US: for English(USA).

See how to implement it in the example below:

import {
  ...
  UnicoCheckBuilder,
  LocaleTypes
  ...
} from "unico-webframe"

unicoCameraBuilder.setLocale(LocaleTypes.EN_US);
  • A remote activation may be required to be used, if you wish to use it, notify your project manager or Unico support.

  • If not configured, the SDK will use Portuguese as the default language.

Customize Capture Experience


This is an optional step, but highly recommended to ensure the capture process aligns with your company's visual identity.

To customize the capture frame using the Theme Builder, simply create an instance of the UnicoThemeBuilder class and invoke the methods that customize each of the properties of the capture frame, as demonstrated in the example below:

const unicoTheme = new UnicoThemeBuilder()
.setColorSilhouetteSuccess("#0384fc")
.setColorSilhouetteError("#D50000")
.setColorSilhouetteNeutral("#fcfcfc")
.setBackgroundColor("#dff1f5")
.setColorText("#0384fc")
.setBackgroundColorComponents("#0384fc")
.setColorTextComponents("#dff1f5")
.setBackgroundColorButtons("#0384fc")
.setColorTextButtons("#dff1f5")
.setBackgroundColorBoxMessage("#fff")
.setColorTextBoxMessage("#000")
.setColorCancelButton("#0384fc")
.setColorProgressBar("#0384fc")
.setHtmlPopupLoading(`<div style="position: absolute; top: 45%; right: 50%; transform:
translate(50%, -50%); z-index: 10; text-align: center;">Carregando...</div>`)
.build();

After generating the theme object, as demonstrated above, it must be passed as a parameter to the setTheme method of the unicoCameraBuilder.

unicoCameraBuilder.setTheme(unicoTheme);

Document Capture

In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your Web applications for document capture


Available Document Frames


In this camera mode, there is a capture frame to assist the user in positioning the document correctly. Once the document is positioned properly, the user must click the button to capture the document photo.

The SDK does not perform any kind of validation on what is being captured.

In this camera mode, it is possible to capture the following documents:

  • CPF: Capture the front of the CPF;

  • CNH: Capture the open CNH;

  • CNH Front: Capture the front of the CNH;

  • CNH Back: Capture the back of the CNH;

  • RG Front: Capture the front of the RG;

  • RG Back: Capture the back of the RG;

  • Others: Capture any other document.

Initializing the SDK


To get started, you need to perform 2 simple steps in your project:

Instantiate a new Builder:

const unicoCameraBuilder = new UnicoCheckBuilder();

Specify the path for additional files (if added to your project):

unicoCameraBuilder.setResourceDirectory("/resources");

Configure Frame Size


It is recommended that you configure the size of the frame within your application to optimize the capture area within your WebApp. Below is how to make this configuration for Web Desktop or Mobile.

Often, the frame's functionality can be affected by design systems that have some type of grid system, such as Bootstrap or Material-UI. To minimize this risk, ensure that you position the frame (id="box-camera") in a place in the code where it does not inherit any unwanted CSS rules.

In the Web Desktop versions, it is possible to restrict the size of the frame so that it doesn't use the entire dimension of your WebApp. To do this, simply wrap the frame (id="box-camera") in another HTML tag, as shown in the example below:

<div class="container">
  <div id="box-camera"></div>
</div>

Ideally, you should aim to maintain a proper ratio between height and width, as this will make it easier to frame the user's face. Here's an example:

.container {
  width: 800px;
  height: 600px;
  position: relative;
}

Following the example above, the frame respects the size of the "parent" element, in this case represented by the container. This way, you have the flexibility to implement the frame in the most convenient way for your application (e.g., inside a modal).

Tests involving resizing the screen through your browser's developer mode will not work as expected. It is recommended to perform this type of test by resizing your browser window instead.

For a Web Mobile view, it is recommended that the capture frame occupy 100% of the screen to avoid issues with computer vision algorithms. If the capture area is distorted, the automatic capture feature (Smart Camera) may face issues in tracking the user's face.

Therefore, for the Web Mobile view:

  • The capture frame should occupy 100% of the device screen (100vw/vh);

  • Avoid horizontal or vertical scrolling (this can be minimized by using a modal).

You can check an example of implementation through a project on this page (Angular).

Testing devices using the developer mode in your browser won't work, as the camera used by your browser is the same as on your desktop, which has a resolution vastly different from a mobile device camera. We recommend that such tests be done directly on the device.

Implementing the Callback functions


One of the objects that must be passed as a parameter to the method responsible for rendering the capture frame is the callback object. This object should contain callback functions for success and error cases, as exemplified below:

  const callback = {
    on: {
      success: (obj) => {
        console.log(obj.base64);
        console.log(obj.encrypted);
      },
      error: (error) => {
        console.error(error)
      },
    }
  };

This object is mandatory, and if not properly implemented (covering all success or error events), it raises an exception, which, if not handled, is displayed in the user's console.

Configure and Start Camera


To start the camera with the settings made so far, it is necessary to create an instance of the builder through the build() method.

const unicoCamera = unicoCameraBuilder.build();

Then, with the camera "assembled," the capture mode of the camera must be configured.

The camera preparation is carried out using the prepareDocumentCamera() method, available from the builder. This method takes two parameters:

  • The type of document to be captured, which are:

Parameter
Description

DocumentCameraTypes.CPF

Capture the front of the CPF

DocumentCameraTypes.CNH

Capture the open CNH

DocumentCameraTypes.CNH_FRENTE

Capture the front of the CNH

DocumentCameraTypes.CNH_VERSO

Capture the back of the CNH

DocumentCameraTypes.RG_FRENTE

Capture the front of the RG

DocumentCameraTypes.RG_VERSO

Capture the back of the RG

DocumentCameraTypes.RG_FRENTE_NOVO

Capture the front of the new RG

DocumentCameraTypes.RG_VERSO_NOVO

Capture the back of the new RG

DocumentCameraTypes.OTHERS("descrição")

Capture any other document

This method returns a promise that, when resolved, returns an object that is used to actually open the camera through the open method, which takes as a parameter the callback functions configured in the previous step.

Below is an example using the CNH capture:

Using the UnicoConfig class:

  const config = new UnicoConfig()
    .setProjectNumber("<YOUR_PROJECT_NUMBER>")
    .setProjectId("<YOUR_PROJECT_ID>")
    .setMobileSdkAppId("<YOUR_MOBILE_SDK_APP_ID>")
    .setHostname("<YOUR_HOSTNAME>")
    .setHostInfo("<YOUR_HOST_INFO>")
    .setHostKey("<YOUR_HOST_KEY>");

  unicoCamera.prepareDocumentCamera(
    config, 
    DocumentCameraTypes.CNH
  ).then(cameraOpener => {
    cameraOpener.open(callback);
  }).catch(error => {
    console.error(error);
    // confira na aba "Referências" sobre os erros possíveis
  });

If you need to capture a document for which there is no specific frame (e.g., RNE, among others), use the If you need to capture a document that does not have a specific frame (e.g., RNE, among others), use the frame DocumentCameraType.None, which will provide you with a generic, rectangular frame that can be used to guide any capture.

Making a POST Request to the Client API



Release notes

In this section, you will find all the updates for the Unico IDCloud Flutter SDK


Keep your Android SDK always up to date with the latest available version. Semantic versioning is used to number the versions. For more information, please refer to the article Overview.


Critical Update

  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


  • Native SDK Update:


Overview

In this section you will find all the technical specifications of the by Unico REST APIs


Introduction


by Unico is a channel that provides an infrastructure of identity validation solutions from the IDCloud platform.

Its goal is to simplify the use of the capabilities of the IDCloud platform by offering a solution that can be integrated into your back-end and front-end, enhancing the security of transactions.

With by Unico, you will have a team of security experts and UX design best practices to ensure the best possible conversion in your operation. It can be used responsively on both Desktop and Mobile. Offering the following usage possibilities:

Channel
Redirect
Open.window()
iFrame
Webview
Mensagens

Desktop

Webmobile

App mobile

For the message flow, it is possible to send notifications through the channels of WhatsApp and/or SMS.

Compatible devices


Android
iOS

Compatible with all devices with front camera, Android 8+, armv7 or arm64.

Compatible with all iOS devices version 11 or higher.

Web


Compatible with all devices with a front camera, whether on laptops or mobile devices, adhering to the list of officially supported browsers below:

Native browsers
Mobile browsers
Computer/notebook browsers
  • iOS:

    • version greater than or equal to 12.

  • Android:

    • version greater than or equal to 5.

  • Android:

    • Chrome: version greater than or equal to 90.

  • iOS:

    • Safari: version greater than or equal to 14.1;

    • Chrome: version greater than or equal to 90 (only for IOS version equal to or greater than 14.4).

  • Chrome:

    • version greater than or equal to 85.

  • Firefox:

    • version greater than or equal to 94.

  • Safari:

    • version greater than or equal to 11.

Other browsers are not supported.

Possible Flows


To do this, you will only need to change the flow parameter in the REST API payload, which will give you several verification journey possibilities. See below the table relating the available flows and their respective capabilities:

Flow
Liveness
Identity Verification
Behavior Alert
Document Capture and Reuse
Electronic Signature
Validation (1:1)
Serpro Similarity Return

idlive

id

idlivetrust

idtrust

idunicodocs

idunicosign

idunicodocssign

idunicoserprodocssign

idtrustdocs

idtrustsign

idtrustdocssign

idtoken

idtokentrust

idtokensign

If you use the Document Reuse and Capture capability, consider the following documents:

  • Brazilian ID (RG), Brazilian Driver's License, CIN and Brazilian Passport.

Flow depracateds


Flow with Risk score
Flow
Capabilities

idcheck

Liveness + Identity Verification + Risk Score

iddocs

Liveness + Identity Verification + Risk Score + Document Capture and Reuse

idsign

Prova de vida + Verificação de IdentidLiveness + Identity Verification + Risk Score + Electronic Signature

iddocssign

Liveness + Identity Verification + Risk Score + Document Capture and Reuse + Electronic Signature

idchecktrust

Prova de vida + Verificação de Identidade + Score de risco + Alerta de comportamento

idchecktrustdocs

Liveness + Identity Verification + Risk Score + Behavior Alert + Document Capture and Reuse

idchecktrustsign

Liveness + Identity Verification + Risk Score + Behavior Alert + Electronic Signature

idchecktrustdocssign

Liveness + Identity Verification + Risk Score + Behavior Alert + Document Capture and Reuse + Electronic Signature

idcheckserpro

Liveness + Identity Verification + Risk Score + Serpro Similarity Return

idcheckserprodocs

Liveness + Identity Verification + Risk Score + Serpro Similarity Return + Document Capture and Reuse

idcheckserprodocssign

Liveness + Identity Verification + Risk Score + Serpro Similarity Return + Document Capture and Reuse + Electronic Signature

creditoconsignado

Liveness + Identity Verification + Risk Score + Serpro Similarity Return + Electronic Signature

This flow works conditionally:

  • If the similarity result from Serpro is positive, we request the electronic signature;

  • If the similarity result from Serpro is negative, we ask for the user's documents to perform the facematch:

    • If the facematch result is positive, we request the electronic signature;

    • If the facematch result is negative, we end the journey without requesting the electronic signature.

The Risk Score capability is being discontinued and can only be used in special cases.

How to integrate


1

Authenticate

First, you must have a service account and perform OAuth2 authentication to obtain a valid access token.

2

Create a Process

With the access token obtained in the previous step, make a POST request to the endpoint client/v1/process (here you will specify the "flow" you wish to use).

3

Define Your User’s Journey

In this step, you will define where your user's journey will take place.

4

Check the Process Result

With the access token obtained in step 1, make a GET request to the endpoint client/v1/process/{id} (here you will provide the "id" of the process created in step 2), check the process result, and decide whether to approve or reject the user.


Error Handling Guide

In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Web applications



This object is returned whenever an error occurs in the Web SDK.

Available Methods


Method Name
Description

getCode()

Method used to obtain the error code that occurred.

getDescription()

Method used to obtain the description of the error that occurred.


Below is a list of possible error codes from the Web SDK, in the prepareCamera method:

73000

Unknown and unexpected error. Unico SDK leverages a variety of APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.

73001

<property> is required

73002

<property> must be an instance of <class>

73003

<class> with name <name> is not available to inject.

73004

Class type must be a function or a class.

73005

Could not find the <locale> locale.

73006

Could not find text: <text>.

73100

Unable to connect to internet.

73200

Could not find the Unico SDK JSON file.

73201

Could not load the Unico SDK JSON file.

73202

Unico SDK JSON file is invalid.

73204

Unable to initialize the SDK, please configure the environment on setEnviroment method of build.

73300

Could not authenticate this application.

73301

Could not authenticate this application.

73302

Authentication token not found.

73303

Current host is not registered.

73400

Could not initialize camera.

73401

Could not load ML models for this camera.

73402

The Key could not be verified due to connectivity issues on the user's device.

73403

This device/platform/browser/version combination is not supported by SDK.

73404

Device is in landscape display orientation. The SDK can only be used in portrait display orientation.

73405

Device blocked due to multiple failed attempts.

73406

The Session was cancelled, the SDK was opened in an IFrame.

73407

The SDK was not fully loaded.

73500

Could not get session.

73501

Could not get session.

73502

Session token not found.

73600

Could not find camera resource.

73601

Could not start camera in production mode.

74000

Invalid hexadecimal.

74001

Object is not a UnicoTheme


Code
Description

73700

Could not parse camera response.

73704

The user pressed the cancel button and did not complete the session.

73706

The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to not allow access by a device policy.

73707

The session was canceled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the background.

73708

The session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor and thus portrait is required.

73710

The session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set by the developer.

73715

The session was cancelled because not all guidance images were configured.

73716

The session was cancelled because SDK was unable to start the camera on this device.

73717

The session was cancelled because the user was in a locked out state.

73718

The session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.

73720

The developer programmatically called the session cancel API.

73721

The session was cancelled due to a device orientation change during the session.

73722

The session was cancelled because the document is not ready.

73723

The session was cancelled because there was another session in progress.

73724

The session was cancelled because the camera was opened in an iFrame.

73728

Connection error, please use HTTPS to connect.

73729

Browser not supported, please open in another browser.

73730

Unable to initialize an active liveness session because of an unknown and unexpected license error.

73731

Unable to initialize an active liveness session because the license has expired.

73732

Unable to initialize an active liveness session because Origin is not permitted.

73800

Could not encrypt response.

73900

Could not get system information.


Glossary

Here you will find a list of terms, words, or technical expressions used in this documentation, along with their respective descriptions.


Term
Description

APIKey

Key created in the Unico portal, used mandatorily in the interface between systems, carrying configurations that will be applied in the integrations. Unique for each operation/flow and always linked to the branch and service account.

File .pem

It is a file containing the private key used for OAuth2 authentication.

Bundle

It is a package containing the credentials for using the SDK.

Service account

It is a non-personal account that belongs to the application and not to an individual user, used for OAuth2 authentication.

Branch

Identification of the client's branch or operation, linked to the service account and all users who will have access to the system.

Instance

URL of the page for accessing Unico's product portal.

Encrypted

An JWT file generated by our SDK, which will be used in the integration. It has a 10-minute expiration and can only be used once

IDCloud Portal

Local Access point to Unico's product.

ProcessID

Identification generated after the process is created.

SDK

It is a set of tools or packages provided by Unico to facilitate the capture of face images and/or documents.

Flow

It is an attribute that carries configurations and defines the end customer's journey in the biometrics process in by Unico.

TenantID

It is a unique identifier for your company within Unico.

Capabilities

These are the functionalities that can be utilized on the IDCloud platform.

Drop

É quando uma foto é recusada pelo motor de bioIt occurs when a photo is rejected by the biometrics engine due to low quality and/or some error from the engine.


Best Practices for SDK Implementation

In this section, you will find a list of best practices for implementing the Unico IDCloud platform SDK


Use a PoC to Facilitate Your Implementation


Always Keep Your SDKs Updated


The SDKs are constantly evolving to ensure greater security and new features and functionalities. It is essential for clients to maintain a routine of updates, as well as to be agile in applying critical updates.

Identify the Latest Version Available for the SDK


It is important to ensure that you update to the most recent version available:

Avoid Updating the SDK and Other Components/Functionalities Simultaneously


We understand that your application makes use of various other libraries and functionalities, often being loaded simultaneously with the Unico SDK. As a best practice for updates, avoid upgrading our SDK at the same time you update any other functionality or library. This is because, if you encounter a failure or a change in behavior, it may be challenging to identify the root cause. We recommend performing updates separately to ensure better control over validations, as well as using our staging environment.

Are You Having Difficulty Updating the SDK? We Can Help


If you are having difficulties, open a ticket in our client portal with the following information (to expedite the process):

  • What is the language of the SDK you are trying to update?

  • If it’s mobile (Android or iOS), is it a native or hybrid implementation (please provide details)?

  • In the case of JavaScript implementation, which framework is being used?

  • What is the current version of the SDK you are trying to update? (not necessary if it's a new installation);

  • What is the new version you are attempting to install/update?

  • Please provide the API Key you are using;

  • Does the update consist solely of upgrading the SDK, or are other components/functionalities also being changed/updated/modified? If so, please describe which additional items are being modified;

  • Provide a description of the steps executed and what the results/errors were;

  • Please attach evidence and inputs related to the failure/problem (log files containing error/failure excerpts, screenshots, and/or videos reproducing the problem).

Do not Manipulate the JWT Object (Encrypted)


When successfully capturing an image, the onSuccessSelfie method returns an object of type ResultCamera which has two attributes:

  • Base64 of the obtained image, which can be used if you want to display a preview of the image in your app;

  • Encrypted, which is a JWT object that must be sent in the REST API calls. The JWT (Encrypted) should be used strictly during image submission through Unico's APIs. You should not open or serialize this attribute, as its characteristics may change without prior notice. Its use should be exclusive for interactions with the APIs to ensure data integrity and security. Unico is not responsible for any damages arising from this practice, as modifications can occur unpredictably. As mentioned, the SDK already provides the Base64 attribute to obtain the image in question.

Um caso de exemplo em Swift: Método: onSuccessSelfie print("(result.encrypted)") para Encrypted print("(result.base64)") para para Base64 print("(result)") para Encrypted e Base64

In summary: never attempt to read or manipulate the Encrypted (JWT) attribute.

Send the JWT Within 10 Minutes


For security reasons, the JWT must be sent within a period of 10 minutes. If the sending exceeds this window, the package will be considered invalid. Consider this time during the user's journey in your application and avoid subsequent changes.

Send the JWT Only Once


For security reasons, the JWT must be sent only once to Unico's backend. If there is a problem processing the image and/or an error in the response, a new biometric capture must be performed to generate a new encrypted object and then send this new file to Unico's backend.

Do Not Use Virtualization


Virtualizing devices in your application's testing dynamics can be interpreted as an attempt to bypass the security layers incorporated into the biometrics provider, potentially returning the errors:

  • Mobile:

    • 73006 - Unable to open camera on emulators.

  • Web:

    • 73600 - Could not find camera resource.

    • 73400 - Could not initialize camera.

To avoid rework and incorrect error identification, tests should be conducted on physical devices.

Use the Same API Key for Capturing and Sending the Photo to the Backend


All communication and requests are based on API Keys previously defined in the client's instance. It is very important that your implementation uses the same API Key in both the capture and submission flows, as this helps avoid integration errors, facilitates validation, and ensures traceability of processes and flows.

If you have any questions about your API Key, please contact technical support.

Do Not Keep DevTools Open When Performing Web Captures


During testing and validation processes, it is normal to keep DevTools open to check flows and requests. However, the capture validation method should not be considered during these tests, as the SDK identifies it as a possible fraud and invalidates the submission when sent to the backend. Therefore, when performing end-to-end flows, it is essential to keep DevTools disabled and proceed with normal capture.

Delete "Resources" Files When Updating to New Versions (Web)


When uploading versions for the WEB SDK, if there is also an update for resource files, always delete the old file and insert the new ones in the Public folder. This is because files may have the same name and not be replaced. Also, ensure that there is no internal cache of the old resource files after the update and new build.

Implementations in Flutter Applications Must Use Our Flutter Plugin


For implementation in Flutter applications, always use our specific Flutter plugin for this purpose. We reinforce that you should not try to implement the native versions of our SDK (Android, iOS) through bridges in Flutter applications, as this action often generates errors not mapped by Unico's engineering team.

Separate the Preparation and Camera Opening Flow into 2 Steps


The SDK implementation has 2 steps until the photo capture and generation of the encrypted:

  • Camera preparation;

  • Camera opening.

In the first step, you need to specify the type of camera to be used and the bundle with the API KEY information. If everything is correct, the authentication with the SDK backend is successfully carried out. In the second step, the camera is opened, usually triggered by a button click from the user. Authentication with the SDK backend may take a few seconds, so placing this step along with the camera opening in the user's button click can create frustration and a sense of slowness. Therefore, the ideal approach is to prepare the camera during the loading of the capture orientation page, so when the user decides to open the camera, the loading will be faster, enhancing the final experience.

This way, you will optimize your implementation and improve the speed of your application, reducing the perception of slowness in processing for your end user.

Cache Cleaning When Updating the Mobile SDK


Always perform cache cleaning before building and uploading new versions. If this cleaning is not performed, you may encounter errors related to cached dependencies that may have been removed or updated in new versions. Below are some examples of how to do this:

  • For Flutter, use the command:

    • Remove the file: pubspec.lock or;

    • flutter pub get.

  • For iOS, use the command:

    • pod cache clean 'unicocheck-ios' –all or;

    • pod cache clean –all or;

    • Remove podfile.lock and follow up with pod install.

  • For Android in build Gradle, use the command:

    • ./gradlew clean.

Obfuscation Settings


Obfuscation is a process of transforming bytecode into a form that is less human-readable, thus making reverse engineering more difficult. The obfuscation tool used in your application can affect the functionality of the SDK, so it is important that the SDK code is not obfuscated. A good indicator of obfuscation issues is when your application works in debug mode but fails when building in release mode, since obfuscation does not modify files in debug mode.

Therefore, it is essential that during the SDK implementation, you add the necessary obfuscation rules for the Unico SDK. Otherwise, you may face issues when trying to build the project using the iOS, Android, or Flutter SDK.

Below are the links for the obfuscation configuration for each OS:

Perform Tests and Validations in Unico's Staging Environment


Unico provides a staging environment for clients to perform tests and validations of their implementations before making any changes and modifications to the production environment. We emphasize the importance of this step in order to ensure greater security when performing the change window in production. Ensure that your testing plan includes as many validations and scenarios as possible that you will encounter in the production environment (such as device variations, tests with limited connectivity, etc.).

Important: remember that the staging environment has its own set of configurations/parameters, such as service account and specific API Keys (different from the production environment).

Create a Safe Checklist for Production Rollout


  • Create a script / checklist considering your company's change management plan.

  • Make sure you are using the correct production settings (such as the correct API Key).

  • Ensure that you have a rollback (recovery) plan in case of failure when deploying the new version to production.

  • When encountering a failure, collect all logs and relevant inputs.

  • Reactivate the previous functional version to mitigate impact in production.

  • Open a ticket on our customer portal containing all the information and inputs regarding the failure so that we can assist you.


Available PoCs

In this section, you will find the list of all available SDK PoCs to support your implementation


The following project examples are provided to facilitate the understanding of how each SDK works. Please request them from your Project Manager.

PoCs in Native Environment


Programming Language
Description
Repository

Kotlin

PoC in Kotlin that implements the Android SDK

Swift

PoC in Swift that implements the iOS SDK

ObjC

PoC in ObjC that implements the iOS SDK

React Native

PoC in React Native that implements the iOS and Android SDK

SFTP

Flutter

PoC in Dart that implements the Flutter SDK

Our support is limited to applications developed directly on the native Android and iOS platforms, using their respective native modules, as well as the Flutter framework (if the implementation uses our plugin). At the moment, we do not offer support for applications developed with hybrid frameworks, such as React Native, Ionic, or other cross-platform development technologies.

PoCs in Web Environment


Programming Language
Description
Repository

Angular

PoC in Angular that implements the Web SDK

JS Vanilla

PoC in JS Vanilla (JS) that implements the Web SDK

Next JS

PoC in Next that implements the Web SDK

React JS with TypeScript

PoC in React with TypeScript that implements the Web SDK

React JS with JavaScript

PoC in React with JavaScript that implements the Web SDK

React JS with Webpack + Babel

PoC in React JS with Webpack + Babel that implements the Web SDK

SFTP

Vue JS

PoC in Vue JS that implements the Web SDK


Programming Language
Description
Repository

Android

PoC in an Android Webview that runs the Web SDK

SFTP

Android x Web Flow

PoC of communication flow between web application and native Android Webview

SFTP

iOS

PoC in an iOS Webview that runs the Web SDK

SFTP

iOS x Web Flow

PoC of communication flow between web application and native iOS Webview

SFTP


Installation Guide

In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your Flutter applications


Development Environment Prerequisites


Your development environment must meet the following prerequisites:

  • Have the Flutter Developer SDK installed.

The capture component provided through the Flutter SDK supports the following versions or higher for the technologies:

  • Android: 5.0 (API 21);

  • iOS: 11.

Compatible Devices


This SDK does not work on emulators, only on physical devices.

iOS Devices::

  • iOS: It is compatible with almost all devices running iOS 11.

Android Devices:

  • It is compatible with the vast majority of devices running Android 5.0 (API level 21) or higher.

The following table lists the devices tested in the lab, along with the availability of vendor/manufacturer extensions. Some extensions listed may be subject to specific manufacturer APIs or SKUs. Click below to see the tested devices:

ASUS - X01BDA

10.0.0

Físico

ASUS - Z01KD

8.0.1

Físico

HUAWEY - P30 Lite

9.0.0

Físico

LG - K22

10.0.0

Físico

LG - Q6

7.0.0

Físico

MOTOROLA - Moto one macro

10.0.0

Físico

MOTOROLA - Moto G4

6.0.1

Físico

MOTOROLA - Moto G5s Plus

8.1.0

Físico

MOTOROLA - Moto G6 Play

9.0.0

Físico

MOTOROLA - Moto G7 Play

10.0.0

Físico

MOTOROLA - Moto G7 Power

10.0.0

Físico

MOTOROLA - Moto G8 Power Lite

10.0.0

Físico

SAMSUNG - A01

10.0.0

Físico

SAMSUNG - J8 SM J810M

8.1.0

Físico

SAMSUNG - Galaxy A30s SM-A307GT

10.0.0

Físico

SAMSUNG - Galaxy A51

10.0.0

Físico

SAMSUNG - Galaxy A71

11.0.0

Físico

SAMSUNG - Galaxy S20+

11.0.0

Físico

SAMSUNG - s10e

11.0.0

Físico

XIAOMI - Mi 8 Lite

9.0.0

Físico

XIAOMI - Mi 8 Lite

10.0.0

Físico

XIAOMI - Poco X3

10.0.0

Físico

XIAOMI - Redmi Note 8

10.0.0

Físico

XIAOMI - Redmi Note 8 Pro

10.0.0

Físico

XIAOMI - Redmi Note 9

10.0.0

Físico

XIAOMI - Redmi Note 9 Pro

10.0.0

Físico

GOOGLE - Pixel sailfish

8.0.0

Virtual (TestLab)

HUAWEY - ALE L23

5.0.0

Virtual (TestLab)

HUAWEY - ANE LX1

9.0.0

Virtual (TestLab)

HUAWEY - ANE LX2

9.0.0

Virtual (TestLab)

HUAWEY - COR L29

8.1.0

Virtual (TestLab)

HUAWEY - MHA L29

7.0.0

Virtual (TestLab)

HUAWEY - NEO L29

9.0.0

Virtual (TestLab)

SAMSUNG - SC 02J

8.0.0

Virtual (TestLab)

SAMSUNG - SM G891A

9.0.0

Virtual (TestLab)

SAMSUNG - SM G930AZ

8.0.0

Virtual (TestLab)

SAMSUNG - SM G935A

8.0.0

Virtual (TestLab)

SAMSUNG - SM G965N

9.0.0

Virtual (TestLab)

SAMSUNG - SM G965U1

8.0.0

Virtual (TestLab)

SAMSUNG - SM G981U1

10.0.0

Virtual (TestLab)

SAMSUNG - SM J727V

8.1.0

Virtual (TestLab)

SAMSUNG - SM N950F

9.0.0

Virtual (TestLab)

SAMSUNG - SM N950N

9.0.0

Virtual (TestLab)

SAMSUNG - SM N950U

8.0.0

Virtual (TestLab)

SAMSUNG - SM N960F

9.0.0

Virtual (TestLab)

SAMSUNG - SM N960N

9.0.0

Virtual (TestLab)

SAMSUNG - SM N960U1

8.1.0

stLab)

Installing the Flutter SDK


To implement the Flutter SDK from the Unico IDCloud platform into your Flutter app, follow the step-by-step guide listed below:

1

Using the Flutter CLI

To add the Unico Check Flutter SDK to your project, run the following command using the Flutter CLI:

$ flutter pub add unico_check

This command adds the following line to the pubspec.yaml file of your package:

dependencies:
  unico_check: ^2.0.2

Manually fetching packages: The flutter pub add unico_check command implicitly runs flutter pub get. If the package is not installed correctly, make sure that unico_check is listed in your pubspec.yaml file and run flutter pub get manually.

2

Permissions for Camera and Internet Usage

To use the camera opening method in your project, you need to add the permissions before compiling your application. Here’s an example:

<key>NSCameraUsageDescription</key>
<string>Camera usage description</string>

3

Including the Dependency

After configuring the Android SDK, simply import it into your project. To do this, import the package in your Dart code:

main.dart
import 'package:unico_check/unico_check.dart';

4

Obtaining the Credentials

  • Contact the CSs and/or Onboarding team.

  • Request the SDK Key by providing the identifiers of your applications: Bundle Identifier for iOS, PackageID for Android, and Host for WEB.

  • The identifiers of your applications will be linked to the SDK Key by the Unico team.

  • You will receive your SDK Key to implement the AcessoBioConfigDataSource.

5

Embedding the Credentials in Your Project

To embed the SDK Key into the project, implement the AcessoBioConfigDataSource protocol in your class:

  final _configIos = UnicoConfig(
      getBundleIdentifier: "Your BundleIdentifier Ios",
      getHostKey: "Your HostKey Ios"); 

  final _configAndroid = UnicoConfig(
      getBundleIdentifier: "Your BundleIdentifier Android",
      getHostKey: "Your HostKey Android");

  void initUnicoCamera() {
    _unicoCheck = new UnicoCheck(
        listener: this,
        unicoConfigIos: _configIos,
        unicoConfigAndroid: _configAndroid);
  }
Deprecated Method - Dart
  final _configIos = UnicoConfig(
      getProjectNumber: "Your ProjectNumber Ios",
      getProjectId: "Your ProjectId Ios",
      getMobileSdkAppId: "Your MobileSdkAppId Ios",
      getBundleIdentifier: "Your BundleIdentifier Ios",
      getHostInfo: "Your HostInfo Ios",
      getHostKey: "Your HostKey Ios");

  final _configAndroid = UnicoConfig(
      getProjectNumber: "Your ProjectNumber Android",
      getProjectId: "Your ProjectId Android",
      getMobileSdkAppId: "Your MobileSdkAppId Android",
      getBundleIdentifier: "Your BundleIdentifier Android",
      getHostInfo: "Your HostInfo Android",
      getHostKey: "Your HostKey Android");

@override
  void initState() {
    super.initState();
    initUnicoCamera();
    configUnicoCamera();
  }

  void initUnicoCamera() {
    _unicoCheck = new UnicoCheck(
        listener: this,
        unicoConfigIos: _configIos,
        unicoConfigAndroid: _configAndroid);
  }


Release notes

In this section, you will find all the updates for the Unico IDCloud Web SDK


Keep your Android SDK always up to date with the latest available version. Semantic versioning is used to number the versions. For more information, please refer to the article Overview.


Version 3.20.0 - 31/03/2025

  • Update of the Liveness SDK and server with interaction;

  • Fix for handling issues when using LocalStorage.


Version 3.19.3 - 10/03/2025

  • Updated Liveness SDK and Interactive Server.


  • New method to customize fonts in the class UnicoThemeBuilder;

  • Internal product improvements. These improvements do not directly affect the end-user experience, keeping the interface and external functionality unchanged.


  • Internal product improvements. These improvements do not directly affect the end-user experience, keeping the interface and external functionality unchanged.


  • Updated Liveness SDK and Interactive Server;

  • Add frame OTHERS_V2;

  • Internal product improvements. These improvements do not directly affect the end-user experience, keeping the interface and external functionality unchanged.


  • Updated Liveness SDK and Interactive Server;

  • Internal product improvements. These improvements do not directly affect the end-user experience, keeping the interface and external functionality unchanged.


  • Updated Liveness SDK and Interactive Server;

  • Accessibility improvements to the Liveness stream with interaction.


  • Updated Liveness SDK and Interactive Server.


  • Updated Liveness SDK and Interactive Server;

  • Resolution of conflicts between observability tools.


  • SDK Update and Liveness Server Interaction.


Have version 15.0.1 or higher installed (the official development IDE from Apple);

Source: , , .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

ErrorBio Object

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

When invoked, the method receives a parameter of type ErrorBio, which contains details about the error. Learn more about the ErrorBio type in the article of this SDK.

If you need to convert the base64 to bitmap, the standard method does not work for Android. You need to split the string at the comma (,) to make it work. If you want to learn more, read the article:

Capturing the images is only the first part of the journey. After capturing the image, you need to send the base64 generated by the SDK to the by Client REST APIs. Learn more in the section of the by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Version 2.16.5 - 10/12/2024

Version 2.16.4 - 16/10/2024

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been designed to help you implement the Flutter SDK quickly and easily. Below, you will find a step-by-step process for the entire integration. After that, if you wish to customize the experience, be sure to check the section.

If it is necessary to convert the base64 string to a bitmap, the standard method does not work for Android. You need to perform a split at the comma (,) for it to function correctly. If you want to learn more, read the article: .

Capturing the images is only the first part of the journey. After capturing the image, it is necessary to send the base64 generated by the SDK to the REST APIs of by Client. Learn more in the section of by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

UnicoError Object

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been created to help you implement the Flutter SDK quickly and easily. Below is the step-by-step process for the entire integration. After that, if you wish to customize the experience, be sure to check the section.

When invoked, the method receives a parameter of type UnicoError, which contains details about the error. Learn more about the UnicoError type in the SDK's documentation.

If you need to convert base64 to bitmap, the standard method doesn't work for Android. It is necessary to perform a split at the comma (,) for it to work. If you want to know more, read the article:

Capturing the images is only the first part of the journey. After capturing the image, it is necessary to send the encrypted generated by the SDK to the REST APIs of by Client. Learn more in the section of by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Source: , , .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

It is recommended to use Chromium-based webviews with some customizations for better JavaScript performance. You can find an implementation example through our

iOS provides two ways to use webviews in applications: WKWebView and SFSafariViewController. We recommend using SFSafariViewController for better compatibility with DOM resources. You can find an implementation example through our .

To download the AI file for the Unico Check SDK Web, click .

To install the SDK in your project via , simply run the following command:

version 3.19.2.

Done. Once the SDK installation is complete, proceed to the implementation by reading the following

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been designed to help you quickly and easily implement the Web SDK. Below, you'll find the step-by-step process for the complete integration. If you wish to customize the experience further, check out the section.

Starting from version 3.18.0, for the SDK to automatically fetch the additional resources, simply do not implement the setResourceDirectory method and ensure that the are applied correctly.

The UnicoConfig class obtained in

Capturing the images is only the first part of the journey. After capturing the image, it is necessary to send the encrypted data generated by the SDK to the by Client REST APIs. For more information, refer to the section of by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

This guide has been designed to help you implement the Web SDK quickly and easily. Below, you will find a step-by-step process for the entire integration. After that, if you wish to customize the experience, be sure to check the section.

The UnicoConfig class obtained in

Capturing the images is just the first part of the journey. After capturing the image, it is necessary to send the base64 generated by the SDK to the REST APIs of by Client. Learn more in the section of by Client.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Version 4.26.0 - 26/03/2025

Android version 5.32.0 ;

iOS version 2.16.11 .

Version 4.25.0 - 13/03/2025

Android version 5.31.0 ;

iOS version 2.16.10 .

Version 4.24.0 - 27/02/2025

Android version 5.30.1 ;

iOS version 2.16.9 .

Version 4.23.0 - 22/01/2025

Android version 5.29.0 ;

iOS version 2.16.8 .

Version 4.22.0 - 14/01/2025

Android version 5.28.0 ;

iOS version 2.16.7 .

Version 4.21.0 - 18/12/2024

Android version 5.27.0 ;

iOS version 2.16.5 .

Version 4.20.0 - 05/11/2024

Android version 5.25.0 .

Version 4.19.0 - 18/10/2024

Android version 5.24.0 ;

iOS version 2.16.4 .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

by Unico is an integration method of Unico IDCloud that allows clients to integrate more easily and connect different in a single journey. This integration method provides the necessary resources to perform Liveness, Identity Verification, Risk Score, Document Capture and Reuse, and Electronic Signature.

Learn more in .

Learn more in

Will the journey be on the web? You can use the browser's or the .

Will the journey be in your app? You can use a .

Will the journey be in the messaging flow? You can send notifications via WhatsApp and SMS (for this, simply provide the corresponding parameter in the request in step 2).

Learn more in .

To optimize your integration, you can use the to know when the result of your process is completed.

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

ErrorBio Object

Below is a list of possible error codes from the Web SDK, in the openCamera method:

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Unico provides a set of POCs (Proof of Concept) that are implementations in the various languages supported by the SDK. These POCs present functional code examples with flows and methods in the context of the SDK, for educational purposes, making it easier to understand the expected sequence and how to adapt it to the code to be implemented by our clients. You can consult the available POCs through and request them by opening a ticket with our support team via the

For more details, please refer to the SDK

Android: [];

iOS: [];

Flutter: [];

Web: [].

Android: ;

iOS: .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

PoCs in Webview Environment

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

You can check the list of compatible devices on Apple’s official

Done. After completing the SDK installation, proceed to the implementation by reading the following .

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Version 3.19.2 - 29/01/2025

Version 3.19.1 - 20/01/2025

Version 3.19.0 - 17/01/2025

Version 3.18.11 - 18/12/2024

Version 3.18.10 - 10/12/2024

Version 3.18.9 - 18/11/2024

Version 3.18.8 - 24/10/2024

Versão 3.18.7 - 15/10/2024

Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our .

Xcode
Bitrise
Xcode 16 release notes
Stackoverflow
​
Help Center
​
​
Help Center
error handling
How to convert a Base64 string into a Bitmap image to show it in an ImageView?
CreateProcess
​
Help Center
​
Help Center
​
​
​
Help Center
​
Help Center
Flutter Customization
How to convert a Base64 string into a Bitmap image to show it in a ImageView?
CreateProcess
​
Help Center
​
​
Help Center
Flutter Customization
error handling
How to convert a Base64 string into a Bitmap image to show it in an ImageView?
CreateProcess
​
Help Center
Bitrise
Xcode 16 release notes
Stackoverflow
​
Help Center
PoCs here.
PoCs here
here
npm
Download
usage and integration guide:
​
Help Center
Web Customization
CSP configurations for using the SDK
this step;
CreateProcess
​
Help Center
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden.
​
Help Center
​
Help Center
Web Customization
this step;
CreateProcess
​
Help Center
​
release notes
release notes
​
release notes
release notes
​
release notes
release notes
​
release notes
release notes
​
release notes
release notes
​
release notes
release notes
​
release notes
​
release notes
release notes
​
Help Center
capabilities
Authentication
CreateProcess.
Redirect
SDK
Webview
CreateProcess
GetProcess
Webhook
​
Help Center
​
​
​
Help Center
​
Help Center
this link
client portal.
update policy.
list of versions
list of versions
list of versions
list of versions
Link to Android obfuscation documentation
Link to iOS obfuscation documentation
​
Help Center
​
​
Help Center
support channels.
Usage and Integration Guide
​
Help Center
​
​
​
​
​
​
​
​
​
Help Center
LogoGuia de uso e integração | IDCloud APIs
LogoUsage and Integration Guide | IDCloud - DevCenter
9.7.39
9.7.36
9.7.33
9.7.31
9.7.29
9.7.27
9.7.25
9.6.92
9.6.89
9.6.85
9.6.84
9.6.73
9.6.65
9.6.56
9.6.53
9.6.40
9.6.38
9.6.33
9.6.30
9.6.26
9.6.24
9.6.16
9.6.11
9.6.4
9.4.18
9.4.14
9.4.11
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
GitHub
338KB
oauth2.postman_collection.json
132KB
Plataforma Unico.postman_collection.json
877KB
byClient.postman_collection
Exemplo de conjunto probatório

GetDocumentSigned

get

Endpoint to retrieve the signed document in PDF format. Only for flows with electronic signature.

Authorizations
Path parameters
id-documentstringRequired

Document ID.

Responses
200
Signed document obtained successfully.
application/pdf
Responsestring · binary

PDF file generated by the system.

401
Error in access-token.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
get
GET /api/v1/service/file/{documentId} HTTP/1.1
Host: signhom.acesso.io
Authorization: Bearer JWT
Accept: */*
binary

GetEvidenceSet

get

Endpoint to retrieve the evidence set from the identity verification process by Unico.

Authorizations
Path parameters
idstringRequired

Process ID.

Responses
200
Evidence set obtained successfully.
application/json
400
When the process ID is invalid.
application/json
401
Error in access-token.
application/json
404
When it was impossible to find the process.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
get
GET /client/v1/process/{processId}/evidenceset HTTP/1.1
Host: api.cadastro.uat.unico.app
Authorization: Bearer JWT
Accept: */*
{
  "fileContents": "JVBERi0xLjUNCiWDk[...]NCg==",
  "contentType": "x-pdf"
}

GetEvidenceSign

get

Endpoint to retrieve the evidential set of the signature. Only for flows with electronic signature.

Authorizations
Path parameters
id-documentstringRequired

Document ID.

Responses
200
Evidential set obtained successfully.
application/pdf
Responsestring · binary

PDF file generated by the system.

401
Error in access-token.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
get
GET /api/v1/service/evidence/{documentId} HTTP/1.1
Host: signhom.acesso.io
Authorization: Bearer JWT
Accept: */*
binary

GetReusableDocuments

get

Endpoint to get a user's documents for reuse in by Client.

Query parameters
codestringRequired

User identifier value (e.g., CPF value).

Example: 12345678909
typestringRequired

Document type (e.g., BR_CPF).

Example: BR_CPF
Header parameters
AuthorizationstringRequired

Valid access-token.

APIKEYstringRequired

Valid APIKEY with the capabilitie Document Capture and Reuse enabled.

Responses
200
Process information retrieved successfully.
application/json
400
Invalid payload.
application/json
403
Missing APIKEY parameter in the request header.
application/json
404
When the process is not found.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
get
GET /documents/v1/client/v1/process HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Accept: */*
{
  "items": [
    {
      "documentType": "unico.moja.dictionary.br.rg.v2.Rg",
      "documentId": "2aaf6037-0153-415d-b9fe-cf7e8198408f"
    }
  ]
}

GetSelfie

get

Endpoint to retrieve the selfie from the Unico process.

Path parameters
idstringRequired

Process ID.

Query parameters
rawbooleanOptional

Optional flag to return the raw selfie file.

Example: true
Responses
200
Selfie obtained successfully.
application/json
400
When the process ID is invalid.
application/json
401
Error in access-token.
application/json
403
When the service account does not have permission to obtain the selfie.
application/json
404
When it was impossible to find the process.
application/json
500
Unexpected error (internal error or parameter issue).
application/json
get

Get Process

get

Endpoint to get the result of a Liveness + Identity Verification + Behavior Alert + Risk Score process by Client.

Path parameters
processIdstringRequired

Process ID.

Header parameters
AuthorizationstringRequired

Valid access token.

APIKEYstringRequired

Valid APIKEY with the capabilities Liveness + Identity Verification + Behavior Alert + Risk Score enabled.

Responses
200
Process information successfully retrieved.
application/json
400
Invalid payload.
application/json
403
Missing APIKEY parameter in request header.
application/json
404
Process not found.
application/json
410
Process created with error.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
get
GET /client/v1/process/{processId}/selfie HTTP/1.1
Host: api.cadastro.uat.unico.app
Accept: */*
{
  "fileContents": "/9j/4AAQSkZJRgABAQA[...]QkeQUjE",
  "contentType": "image/jpeg"
}
GET /processes/v1/{processId} HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Accept: */*
{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "liveness": 1,
  "unicoId": {
    "result": "inconclusive"
  },
  "identityFraudsters": {
    "result": "inconclusive"
  },
  "faceWithOtherId": {
    "result": "inconclusive"
  },
  "score": 50
}

Create process

post

Endpoint to create a new Document process via Client.

Header parameters
AuthorizationstringRequired

Valid access token.

APIKEYstringRequired

Valid APIKEY with the capabilitie Document Capture and Reuse enabled.

Body
Responses
200
Process information successfully retrieved.
application/json
400
Invalid payload.
application/json
403
Missing APIKEY parameter in the request header.
application/json
500
Unexpected error (Internal error or parameter issue).
application/json
post
POST /processes/v1 HTTP/1.1
Host: api.id.uat.unico.app
Authorization: text
APIKEY: text
Content-Type: application/json
Accept: */*
Content-Length: 240

{
  "subject": {
    "code": "12345678909",
    "name": "Luke Skywalker",
    "email": "luke@unico.io",
    "phone": "551972557070"
  },
  "document": {
    "purpose": null,
    "authProcessId": "80371b2a-3ac7-432e-866d-57fe37896ac6",
    "documentId": "80371b2a-3ac7-432e-866d-57fe37896ac6"
  }
}
{
  "id": "2b034568-dfaf-463f-94fb-18ed93c312e8",
  "status": 3,
  "document": {
    "id": "b97c3fd9-d95d-413f-bc0a-75eb87304421",
    "type": "Driver's License",
    "cpfMatch": false,
    "faceMatch": false,
    "content": {
      "numero": "044589731564",
      "rgNumero": "123456789 SESP PR",
      "nomeCivil": "Homer Simpson",
      "filiacao": [
        "Monasimpson",
        "Monasimpson"
      ],
      "dataNascimento": "1990-05-12T00:00:00Z",
      "dataHabilitacao": "1997-11-18T00:00:00Z",
      "dataExpiracao": "2017-12-07T00:00:00Z",
      "dataEmissao": "2012-12-07T00:00:00Z",
      "localEmissao": "Curitiba PR",
      "categoria": "B",
      "renachNumero": "PR904987581"
    },
    "fileUrls": [
      "https://url-signer-1",
      "https://url-signer-2"
    ]
  }
}