FACEKIBLAZEAPIClientLibrary 1.0.0

dotnet add package FACEKIBLAZEAPIClientLibrary --version 1.0.0                
NuGet\Install-Package FACEKIBLAZEAPIClientLibrary -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FACEKIBLAZEAPIClientLibrary" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FACEKIBLAZEAPIClientLibrary --version 1.0.0                
#r "nuget: FACEKIBLAZEAPIClientLibrary, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FACEKIBLAZEAPIClientLibrary as a Cake Addin
#addin nuget:?package=FACEKIBLAZEAPIClientLibrary&version=1.0.0

// Install FACEKIBLAZEAPIClientLibrary as a Cake Tool
#tool nuget:?package=FACEKIBLAZEAPIClientLibrary&version=1.0.0                

FACEKI BLAZE API Client Library

FACEKIBLAZEAPIClientLibrary is a .NET client library for interacting with Faceki's KYC (Know Your Customer) API. This library simplifies the process of integrating with Faceki by handling authentication, document uploads, face verification, and KYC link generation.


Features

  • Authentication: Automatically handles OAuth2 token-based authentication and token renewal.
  • Document Upload: Upload KYC documents for verification from file paths, streams, or URLs.
  • Face Search: Perform face searches using image files or URLs.
  • KYC Verification Links: Generate KYC verification links with optional expiration, workflow, and redirect parameters.
  • Base64 Conversion: Convert images from URLs into base64 format for use in other APIs.

Installation

You can install the FACEKIBLAZEAPIClientLibrary package from NuGet using either the .NET CLI or the NuGet Package Manager.

.NET CLI

dotnet add package FACEKIBLAZEAPIClientLibrary

NuGet Package Manager

Install-Package FACEKIBLAZEAPIClientLibrary

Requirements

  • .NET Framework 4.7.2 or higher
  • Faceki Account: You will need a clientId and clientSecret from Faceki.
  • Valid Internet Connection: All requests to the Faceki API require an internet connection.

Getting Started

Authentication

To use the API, you must initialize the FacekiApiClient class with your clientId and clientSecret. The library will automatically handle the authentication token and its renewal.

var facekiClient = new FacekiApiClient("your-client-id", "your-client-secret");

Fetch Verification Result

You can fetch a KYC verification result using optional parameters such as requestId, face_id, link, or record_identifier.

var result = await facekiClient.GetVerificationResultAsync(
    requestId: "your-request-id",
    face_id: "your-face-id",
    link: "your-link",
    record_identifier: "your-record-identifier"
);
Parameters:
  • requestId (Optional): The unique ID of the KYC request.
  • face_id (Optional): The ID associated with a face for verification.
  • link (Optional): The verification link for the KYC request.
  • record_identifier (Optional): A custom identifier for the record, if applicable.

Response Data Structure: Documentation


Upload Documents for KYC Verification

You can upload documents and a selfie for KYC verification using one of three methods: file paths, streams, or URLs.

Upload From File Paths

To upload documents and a selfie from local file paths:

var response = await facekiClient.PerformEKYCFromPathsAsync(
    workflowId: "your-workflow-id",
    link: "your-link",
    document1FrontPath: "path-to-document-front.jpg",
    selfiePath: "path-to-selfie.jpg",
    document1BackPath: "path-to-document-back.jpg",
    document2FrontPath: "path-to-second-document-front.jpg",
    document2BackPath: "path-to-second-document-back.jpg",
    document3FrontPath: "path-to-third-document-front.jpg",
    document3BackPath: "path-to-third-document-back.jpg",
    recordIdentifier: "your-record-identifier"
);
Parameters:
  • workflowId (Required): The workflow ID for the KYC verification process.
  • link (Required): The verification link associated with the KYC request.
  • document1FrontPath (Required): Path to the front image of the first document.
  • selfiePath (Required): Path to the selfie image.
  • document1BackPath (Optional): Path to the back image of the first document.
  • document2FrontPath (Optional): Path to the front image of the second document.
  • document2BackPath (Optional): Path to the back image of the second document.
  • document3FrontPath (Optional): Path to the front image of the third document.
  • document3BackPath (Optional): Path to the back image of the third document.
  • recordIdentifier (Optional): A custom record identifier, if applicable.

Response Data Structure: Documentation


Upload From Streams

To upload documents and selfies using file streams:

using (var document1FrontStream = File.OpenRead("path-to-document-front.jpg"))
using (var selfieStream = File.OpenRead("path-to-selfie.jpg"))
{
    var response = await facekiClient.PerformEKYCFromStreamsAsync(
        workflowId: "your-workflow-id",
        link: "your-link",
        document1FrontStream: document1FrontStream,
        document1FrontFileName: "document-front.jpg",
        selfieStream: selfieStream,
        selfieFileName: "selfie.jpg",
        document1BackStream: File.OpenRead("path-to-document-back.jpg"),
        document1BackFileName: "document-back.jpg"
    );
}
Parameters:
  • workflowId (Required): The workflow ID for the KYC verification process.
  • link (Required): The verification link associated with the KYC request.
  • document1FrontStream (Required): Stream for the front image of the first document.
  • document1FrontFileName (Required): File name of the first document's front image.
  • selfieStream (Required): Stream for the selfie image.
  • selfieFileName (Required): File name of the selfie image.
  • document1BackStream (Optional): Stream for the back image of the first document.
  • document1BackFileName (Optional): File name of the first document's back image.
  • document2FrontStream, document2BackStream, document3FrontStream, document3BackStream (Optional): Streams for additional document images.
  • recordIdentifier (Optional): A custom record identifier, if applicable.

Response Data Structure: Documentation


Upload From URLs

To upload documents and selfies from URLs:

var response = await facekiClient.PerformEKYCFromUrlAsync(
    workflowId: "your-workflow-id",
    link: "your-link",
    document1FrontUrl: "https://example.com/document-front.jpg",
    selfieUrl: "https://example.com/selfie.jpg",
    document1BackUrl: "https://example.com/document-back.jpg",
    document2FrontUrl: "https://example.com/second-document-front.jpg"
);
Parameters:
  • workflowId (Required): The workflow ID for the KYC verification process.
  • link (Required): The verification link associated with the KYC request.
  • document1FrontUrl (Required): URL to the front image of the first document.
  • selfieUrl (Required): URL to the selfie image.
  • document1BackUrl, document2FrontUrl, document2BackUrl, document3FrontUrl, document3BackUrl (Optional): URLs to additional document images.
  • recordIdentifier (Optional): A custom record identifier, if applicable.

Response Data Structure: Documentation


Face Search by Image

You can search for face matches by providing either an image file path or an image URL.

Search by File Path
var result = await facekiClient.FaceSearchByImageOrUrlAsync(imagePath: "path-to-your-image.jpg");
Search by URL
var result = await facekiClient.FaceSearchByImageOrUrlAsync(imageUrl: "https://example.com/image.jpg");
Parameters:
  • imagePath (Optional): The file path to the image for face search.
  • imageUrl (Optional): The URL of the image for face search.

Response Data Structure: Documentation


You can generate a KYC verification link that users can use to complete the verification process.

var response = await facekiClient.CreateKycVerifyLinkAsync(
    workflowId: "your-workflow-id",
    expiryTime: 0, // Optional: link expiration time in mins
    applicationId: "your-application-id", // Optional
    redirectUrl: "https://your-app.com/redirect" // Optional
);
Parameters:
  • workflowId (Required): The workflow ID for the KYC process.
  • expiryTime (Optional): Time in mins for the link to expire.
  • applicationId (Optional): Unique Identifier for record from your system
  • redirectUrl (Optional): URL to redirect users after completing the KYC process.

Convert Image URL to Base64

You can convert an image from a URL into a base64-encoded string for other purposes, such as embedding images.

var base64Image = await facekiClient.ConvertImageUrlToBase64Async("https://example.com/image.jpg");
Parameters:
  • imageUrl (Required): The URL of the image to convert to base64.

Generate Access Token

You can convert an image from a URL into a base64-encoded string for other purposes, such as embedding images.

// Initialize the Faceki API Client
var facekiClient = new FacekiApiClient("your-client-id", "your-client-secret");

// Call the GenerateTokenAsync method to get a token
string accessToken = await facekiClient.GenerateTokenAsync();

// Use the token for authentication in subsequent API requests
Console.WriteLine($"Generated Access Token: {accessToken}");


Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 86 10/6/2024