Unico IDCloud - DevCenter
HomepageAuthenticationAPIsSDKs
English (United States)
English (United States)
  • Welcome
  • GETTING STARTED
    • Unico IDCloud
    • Capabilities
    • Integration Methods
    • Capabilities and Integration Methods
  • INTEGRATIONS
    • Quickstart
    • Authentication
      • Creating a Service Account
      • Preparing to Make an Authenticated API Request
      • Additional Resources
        • Example in Javascript
        • Authentication Errors
        • Postman Collection
    • Integration by Unico
      • Overview
      • API
        • API Reference
          • CreateProcess
            • CreateProcess separated by flows
          • GetProcess
          • GetSelfie
          • GetEvidenceSet
            • Specification of the evidential set
          • GetDocumentSigned
          • GetEvidenceSign
        • Errors
      • Controlling the experience
        • Redirecting the user
        • SDK
        • QR Code
        • Customizations
      • Additional Resources
        • Postman Collection
        • PoCs available
    • Integration by Client
      • Overview
      • API
        • API Reference
          • Liveness + Identity Verification + Behavior Alert
          • Liveness + Identity Verification + Behavior Alert + Risk Score
          • Liveness + Validation (1:1) + Behavior Alert
          • Document Capture and Reuse
        • Response Scenarios
        • Additional Resources
          • Postman Collection
      • Capture standard (without SDK)
    • Webhook
    • SDK
      • Overview
      • Update Policy
      • SDK Integration
        • Android SDK
          • Installation Guide
          • Usage and Integration Guide
            • Selfie Capture
            • Document Capture
          • Error Handling Guide
          • Android Customization
          • Troubleshooting
          • Release notes
        • iOS SDK
          • Installation Guide
          • Usage and Integration Guide
            • Selfie Capture
            • Document Capture
          • Error Handling Guide
          • iOS Customization
          • Troubleshooting
          • Release notes
        • Flutter SDK
          • Installation Guide
          • Usage and Integration Guide
            • Selfie Capture
            • Document Capture
          • Error Handling Guide
          • Flutter Customization
          • Troubleshooting
          • Release notes
        • Web SDK
          • Installation Guide
          • Usage and Integration Guide
            • Selfie Capture
            • Document Capture
            • Accessibility
          • Error Handling Guide
          • Web Customization
          • Release notes
      • Additional Resources
        • Available PoCs
        • Best Practices for SDK Implementation
  • help & faq
    • Glossary
    • Help Center
Powered by GitBook

Institucional

  • Sobre nós

Copyright © 2024 unico. All rights reserved

On this page
  • Requests separated by flows
  • Other ways to make a request

Was this helpful?

Export as PDF
  1. INTEGRATIONS
  2. Integration by Unico
  3. API
  4. API Reference
  5. CreateProcess

CreateProcess separated by flows

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


Requests separated by flows


This payload is used to create the following flows:

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

{
  "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"
}

This payload is used to create the following flows:

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

{
  "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=="
          }
        ]
      }
    }
  ]
}

This payload is used to create the following flows:

  • idtoken / idtokentrust.

{
  "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"
}

This payload is used to create the following flows:

  • idtokensign.

{
  "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=="
          }
        ]
      }
    }
  ]

Other ways to make a request


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"
}'

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.

{
  "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)
    }
}

PreviousCreateProcessNextGetProcess

Last updated 2 months ago

Was this helpful?

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