OneSpan Sign How To: Using Text Tags

Haris Haidary,

In the upcoming release of OneSpan Sign (11.5), we've added a new Text Tag Extraction feature that automatically extracts signatures and fields by placing Text Tags directly in a document. In other words, OneSpan Sign will analyze the uploaded document, and replace every text that matches the Text Tag pattern with the appropriate signature or field. Version 11.5 is scheduled to be released on August 7th for the sandbox environment and August 17th for production environment. In this blog, I will walk you through an example of how to use Text Tags.

The Code

Let's get straight into it. The Text Tag extraction feature is very straightforward to use. In short, all you need to do is add the "text tags" on your document where you want your signatures and fields to be using OneSpan Sign's nomenclature. Once you upload your document to OneSpan Sign, the text tags will disappear and be replaced with the corresponding signatures and fields. For example, the following is the shortest valid syntax for a text tag:


Where role the is the roleId of your recipient and fieldType is the signature or field type that you want to put. Below is a screenshot of the document I used in my example. It illustrates a few valid example text tags that you can use.

text tags

The Text Tags extraction feature is available through our REST API and SDKs. For a complete description of the new Text Tag feature, refer to our documentation. Once your document is finalized, you need to enable this feature during transaction creation. Below are examples using our Java SDK, .NET SDK, and REST API respectively.

Java SDK

EslClient eslClient = new EslClient( API_KEY, API_URL );

DocumentPackage pkg = PackageBuilder.newPackageNamed("Text Tags Example")
		.withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
		.withDocument(DocumentBuilder.newDocumentWithName("Sample Contract")

PackageId packageId = eslClient.createAndSendPackage(pkg);



EslClient eslClient = new EslClient(API_KEY, API_URL);

DocumentPackage pkg = PackageBuilder.NewPackageNamed("Text Tags Example")
        .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
        .WithDocument(DocumentBuilder.NewDocumentNamed("Sample Contract")

PackageId packageId = eslClient.CreatePackageOneStep(pkg);



Content-Type: multipart/form-data; esl-api-version=11.9; boundary=lKkOm3QpMGT9LnKz
Authorization: Basic YOUR_API_KEY
Content-Length: 13736
Expect: 100-continue
Connection: Keep-Alive


Content-Disposition: form-data; name="payload"; filename="payload"

  "autocomplete": true,
  "documents": [
      "extract": true,
      "extractionTypes": [
      "index": 0,
      "name": "Sample Contract"
  "name": "Text Tags Example",
  "roles": [
      "id": "signer1",
      "index": 0,
      "name": "signer1",
      "signers": [
          "email": "[email protected]",
          "firstName": "John",
          "id": "signer1",
          "lastName": "Smith"
  "status": "SENT",
  "type": "PACKAGE",
  "visibility": "ACCOUNT"


Content-Disposition: form-data; name="file"; filename="C:/Users/hhaidary/Desktop/sample_contract_text_tags.docx"

[doc binaries]


Running Your Code

Once you run your code, you will see that the text tags have disappeared and have been replaced with their corresponding signature and fields.


You can download the sample JSON and document above from the Developer Community Code Share.

If you have questions regarding this blog or anything else concerning integrating OneSpan Sign into your application, visit the developer community forums: That's it from me. Thank you for reading! If you found this post helpful, please share it on Facebook, Twitter, or LinkedIn.

Haris Haidary

Technical Evangelist

LinkedIn | Twitter 

OneSpan Developer Community

OneSpan Developer Community

Join the OneSpan Developer Community! Forums, blogs, documentation, SDK downloads, and more.

Join Today