DocuSign Inc.

04/05/2024 | News release | Distributed by Public on 04/05/2024 09:58

From the Trenches: Creating hyperlinks through the API with the Apex Toolkit

A hyperlink does not exist as a separate tab in Docusign. Instead, users have to create a custom text tab as a Document Custom Field with specified properties. What makes the text tab an actual hyperlink is the addition of #HREF_ in the name. This guide consisting of a few steps explains how it's done through Settings > Document Custom Field.

The problem developers often face is when it comes to converting the steps from guides like this into code and mapping the values to the correct properties. In this case, it's not that complicated: To create a hyperlink with the API, you simply create a text tab, add a few properties, and assign it to the recipient. Let's look at how this is done using the Apex Toolkit.

The code snippet below shows a sample hyperlink to Google. Of course, the link can be any link you need your customers to visit. For example, the link may be to a single document or a page on your website the signer can view before signing the document.

Note: For the hyperlink to work in Apex, properties must be in the exact order as shown below.

Next, add the new text tab to the list of tabs assigned to the recipient.

When creating the envelopes from JSON, the structure of the text tab will be similar, but will follow the eSignature JSON naming convention.

Here's how to create the tab in each of our SDKs.

C#

Java

Node.js

PHP

Python

Ruby

As you can see, creating a hyperlink through the API involves few steps and is very easy.

Additional resources