Skip to main content

.NET Client Library

The Jumio .NET client library facilitates the integration of the Jumio Platform into .NET applications. You configure an instance of the JumioClient class and utilize it to manage interactions with the Jumio Platform.

JumioClient exposes fluent API using the builder design pattern, simplifying the configuration and execution of common interactions with the platform, which include:

  • Initializing the JumioClient
  • Initiating and executing transactions.
  • Retrieving transaction status and details.

Click and download the .NET Client library Collection here.

1. Initializing the JumioClient

JumioClient implements the Builder pattern to streamline configuration and initialization.

To configure JumioClient you need to provide:

  • A DataCenter object representing the Jumio data center your application will use.
  • A string with the value you want to use for the User-Agent header in calls to Jumio.
  • JumioClient supports only OAuth2 credentials, obtained from the Jumio Portal.
  • (optional) An IRequestAdapter instance, if you want to use other then the default HttpClientRequestAdapter implementation.

Example:

  var jumioClient = JumioClientBuilder
.DataCenter(DataCenters.EuTest)
.UserAgent(new UserAgent("User Agent"))
.OAuthCredentials(new ApiCredentials("Insert_api_key", "Insert_api_secret"))
.DefaultRequestAdapter()
.Build();

2. Initiating and Executing Transactions.

2.1. Using Existing Workflows

JumioClient provides two methods with fluent builder interfaces for initiating a transaction:

  • InitiateNewAccount() for initiating a transaction for a new account.
  • AddNewWorkflowToExistingAccount() for initiating a transaction for an existing account.

The builder functions for account creation allow you to set up the callback URL, the tokenLifetime, etc.

Starting the construction of the workflow is done via the StartWorkflow() function. The WorkflowBuilders contains the list of predefined workflow types which are the following:

  • Web-only workflows
  • Workflows with some permutations of front, back image, selfie image, prepared data
  • Workflows with documents

Each workflow has its own predefined steps for ease of use. For non-web-only workflows, user consent to upload data is mandatory.

Example of a web only workflow:

jumioClient
.AddNewWorkflowToExistingAccount(
new CustomerInternalReference("Insert_the_reference"),
WorkflowBuilders.IdIvScreening10032,
new AccountId("Insert_existing_accountId"))
.StartWorkflow()
.WithDefaultCredentials()
.PerformWeb(
new WebSettings()
{
SuccessUrl = "Insert_success_url",
ErrorUrl = "Insert_error_url",
})

Example of a workflow with front, back and prepared data:

 jumioClient
.InitiateNewAccount(
customer,
WorkflowBuilders.StandaloneIdVerification10015)
.CallbackUrl(new CallbackUrl("Insert_callback_url"))
.StartWorkflow()
.WithDefaultCredentials()
.PerformUploadIds()
.UserConsent(consent)
.UploadFront(frontFileStream, "image/jpg")
.UploadBack(backFileStream, "image/jpg")
.Finish();

Example of a workflow with documents:

 jumioClient
.InitiateNewAccount(
customer,
WorkflowBuilders.DocumentVerification10026)
.CallbackUrl(new CallbackUrl("Insert_callback_url"))
.StartWorkflow()
.WithSpecificCredentials(ImmutableArray.Create(credentialRequest))
.PerformUploadDocuments()
.UserConsent(consent)
.UploadDocument(fileStream, "image/jpeg")
.UploadDocument(backFileStream, "image/jpeg")
.UploadDocument(documentStream, "application/pdf")
.Finish()

2.2. Implementing New Workflows

Adding a new workflow is possible by implementing a new instance of the WorkflowBuilderBase<TWorkflow> class. This allows specifying a new workflow with custom steps.

Example of a custom workflow

// The builder class for the workflow.
public class CustomWorkflowBuilder : WorkflowBuilderBase<CustomWorkflow>
{
public CustomWorkflowBuilder(WorkflowType workflowType)
: base(workflowType)
{
}

public override CustomWorkflow CustomWorkflowBuilder(WorkflowService workflowService)
{
return new CustomWorkflow(workflowService);
}
}

// The workflow which defines the credential types and the next workflow step.
public class CustomWorkflow : DefaultOrSpecificCredentialsBase<CustomWorkflowStep>
{
public CustomWorkflow(WorkflowService workflowService)
: base(c => new CustomWorkflowStep(workflowService))
{
}
}

// A workflow with a custom implementation.
public class CustomWorkflowStep
{
private readonly WorkflowService workflowService;

public CustomWorkflowStep(WorkflowService workflowService)
{
this.workflowService = workflowService;
}

public UserConsentStepForTestWorkflow PerformCustomStep()
{
// Custom step implemementation
// Then return the next step
return new UserConsentStepForTestWorkflow(workflowService);
}
}

3. Retrieving Transaction Status and Details

JumioClient provides two retrieveData() methods for retrieving transaction data:

  • public WorkflowExecutionResponse RetrieveData(CallbackRequestBody callbackRequestBody) Use this method when you are Implementing a Callback Service.

  • public WorkflowExecutionResponse RetrieveData(AccountId accountId, WorkflowExecutionId workflowExecutionId) Use this method to retrieve data using the account ID and workflow execution ID.