---
title: "Sample Integration Code"
slug: "sample-integration-code"
updated: 2025-02-14T12:57:31Z
published: 2025-02-14T12:57:31Z
canonical: "docs.onespan.com/sample-integration-code"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onespan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample Integration Code

The sample Java code discussed in this section illustrates how to use the Integration SDK to integrate the OneSpan Sign Application Backend with an External Verification Server.

Specifically, this section discusses:

- [Adding the SDK to Your Project](/v1/docs/sample-integration-code#adding-the-sdk-to-your-project)
- [Sample Java Files](/v1/docs/sample-integration-code#sample-java-files)

## Adding the SDK to Your Project

To add the Integration SDK to your project as a dependency you must download the Integration SDK. To download the Integration SDK, click [here](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/esl-sdk-external-signer-verification-1.0.14.jar).

## Sample Java Files

The following four files of sample Java code illustrate how to use various aspects of the Integration SDK:

1. [VerificationRequestTokenConversion.java](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/verificationrequesttokenconversion.zip)
2. [VerificationResponseTokenGeneration.java](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/verificationresponsetokengeneration.zip)
3. [VerificationRequestTokenGeneration.java](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/verificationrequesttokengeneration.zip)
4. [VerificationResponseTokenConversion.java](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/verificationresponsetokenconversion.zip)

Files 1 and 2 contain code for the External Verification Server. Files 3 and 4 contain code for the OneSpan Sign Application Backend.

### File 1: External Verification Server

File 1 (`VerificationRequestTokenConversion.java`) illustrates how the External Verification Server converts an extracted *Signer Verification Request Token* into a *SignerVerificationRequest* object by calling the method *SignerVerificationProcessor.toSignerVerificationRequest()*.

### File 2: External Verification Server

File 2 (`VerificationResponseTokenGeneration.java`) illustrates how the External Verification Server generates a *Signer Verification Response Token*.

It first retrieves the saved *SignerVerificationRequest* object, and then pulls the *Document Identification Information* as well as the *Callback URL* from it.

It subsequently constructs a *SignerVerificationResponse* object with the *Document Identification Information* as the value of one of its fields.

The *SignerVerificationResponse* object is then converted to a *Signer Verification Response Token* by calling the method *SignerVerificationProcessor.toSignerVerificationResponsePayload()*.

Finally, the result, along with the *Callback URL*, is used to build a redirect URL to send the user back to the [Signer Experience](/v1/docs/signer-experience-settings).

### File 3: OneSpan Sign Application Backend

File 3 (`VerificationRequestTokenGeneration.java`) illustrates how the OneSpan Sign Application Backend constructs a *SignerVerificationRequest*, which is then converted to a *Signer Verification Request Token* by calling the method *SignerVerificationProcessor.toSignerVerificationRequestPayload()*.

The result is subsequently used to build a redirect URL to send the signer to the website of the *External Verification Provider*.

### File 4: OneSpan Sign Application Backend

File 4 (`VerificationResponseTokenConversion.java`) illustrates how the OneSpan Sign Application Backend converts an extracted *Signer Verification Response Token* to a *SignerVerificationResponse* object by calling the method *SignerVerificationProcessor.toSignerVerificationResponse()*.
