OneSpan Sign Developer: Upload Signature for Your Signer

Duo Liang, July 16, 2018

In this blog, I will guide you through what you might have missed in the OneSpan Sign Developer Community during the week of July 07, 2018. Without further ado, let's get started.

In OneSpan Sign, you will only be asked to draw your signature once by the application, even when it requires multiple captured signatures on documents. Any subsequent captured signatures will be automatically replicated by OneSpan Sign.

As you may have noticed, OneSpan Sign can store signatures for the account owner and senders under this main account. So, you may ask, "could I have this feature for other signers? Could I store other signers’ signatures for further use? Could I upload their signatures before package so that signers don’t need to capture their signatures even for the first signature block?"

The answers to these questions are YES! We suggest following these steps to upload signatures for signers.

1. Retrieve the Handdrawn String

OneSpan Sign uses base64 encoding to store and to convert to the signature image, and this encoding is represented in an attribute name of “handdrawn”. To retrieve this string, it could be done in two ways, depending on where you want to retrieve it:

(1) Extract the value from a signed document

Handdrawn attribute includes in the package information, or to make it more exact, in Role block or Approval block, so the following two API calls both work:

GET /packages/{packageId}/documents/{documentId}/approvals/{approvalId}

GET /packages/{packageId}/roles/{roleId}

(2) If you already have the signature in image format in your system, you could convert it to a base64 encoding by this Import Tool. Below is a screen shot of the code pieces.

handdrawn generation


  • OneSpan Sign uses a different method to encode the base64 string, so this string can’t be used for HTML or CSS use. Accordingly, other base64 strings generated by other converters cannot be used to upload as a handdrawn value.
  • Currently, the converter tool is only written in Java.

(3) You can also download the image of signature via following API call and convert it to base64 string by using the import tool:

GET /api/packages/{packageId}/roles/{roleId}/signatureImage

2. Store this Handdrawn Value Properly in Your System Database

3. Use Handdrawn to Create a Package

If you want to upload a captured signature for a signer next time before sending a package, add this handdrawn attribute into Role Block of your request payload as shown below:







               "email":"[email protected]",





                             "handdrawn":"signer's handdrawn value"







By doing so, you could upload signatures for signers. Every capture signature block would be turned into click-to-sign. But still, after clicking the button, if the signature is not shown as signer’s expectation, they can opt out, which provides enough error tolerance for you.

If you have any questions regarding this blog or anything else concerning integrating OneSpan Sign into your application, visit the Developer Community Forums. Your feedback matters to us!

Duo Liang is a Technical Evangelist and Partner Integrations Developer at OneSpan where he creates and maintains integration guides and code shares, helps customers and partners integrate OneSpan products into their applications, and builds integrations within third party platforms.