Skip to content

Lightweight and intuitive package designed to streamline the integration process of dotta biometric service API

License

Notifications You must be signed in to change notification settings

ikeliec/dotta.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

dotta.Net is a lightweight and intuitive package designed to streamline the integration process of dotta API and empower businesses to harness the power of dotta biometric service effortlessly.

dotta offers a wealth of functionality for performing real-time identity verification in the most convenient and efficient approach, but getting started and putting all the codes together can sometimes be complex and time-consuming. With dotta.Net, we've simplified the integration process, allowing you to focus on building amazing applications without getting bogged down in implementation details.

Getting Started

  1. Install the dotta.Net package from NuGet.
dotnet add package dotta.Net
  1. Register dotta.Net as a service in your Program.cs file. dotta.Net is dependent on HttpClient to work, thus it should be registered after registering HttpClient.
// Register HttpClient to enable dotta.Net make http network requests
builder.Services.AddHttpClient();

builder.Services.AddDotta(new DottaServiceOptions
{
    ApiKey = "",
    BaseUrlProduction = "",
    BaseUrlSandbox = "",
    Environment = DottaEnvironment.Sandbox
});

You can also instantiate dotta directly in an implementation logic.

var _dotta = new Dotta(new DottaOptions
{
    ApiKey = "ABCDE",
    BaseUrlProduction = "",
    BaseUrlSandbox = "",
    Environment = DottaEnvironment.Sandbox,
    HttpClient = // pass an instance of httpClient
});
  1. Inject dotta.Net service into any controller or service in your application
private readonly Dotta _dotta;

public ApiController(Dotta dotta)
{
    _dotta = dotta;
}
  1. You can now access any member of the dotta.Net service
var response = await _dotta.FaceAttributes(photo);

Dotta Service Options

Option Description
ApiKey Base64 encode string of your dotta public and private API keys concatenated in this format PUBLICKEY:PRIVATEKEY
PublicKey Your dotta public API key
PrivateKey Your dotta private API key
Environment Enum to specify which dotta environment you want to use
BaseUrlProduction API base url for dotta's production environment.
BaseUrlSandbox API base url for dotta's sandbox or test environment.

Pass the your public and private key if you don't know how to get a base64 string encoding of your keys. Otherwise, just pass the ApiKey. When you pass the ApiKey, you won't need to pass the public and private keys.

Other links