How to set hyperlink form fields while making an electronic signature request via API?

BoldSign supports including a hyperlink when sending the document for a signing request. When signers click the hyperlink, they will be directed to the specified webpage or file. This is useful for providing additional information or resources related to the document being signed.

Specify the fieldType as Hyperlink, and provide the hyperlinkText (Text to Display) along with the Hyperlink URL within the value property.

Please note that it is mandatory that you need to add any other form fields, other than dateSigned and label for a signing request while setting the hyperlink form field.

Code snippet

curl -X 'POST' \
  'https://api.boldsign.com/v1/document/send' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {your API key}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Title="Sample Document"' \
  -F 'Signers={
  "name": "hanky",
  "emailAddress": "hankyWhites@gmail.com",
  "signerType": "Signer",
  "signerRole": "Signer",
  "formFields": [
      {
        "id": "HyperLink",
        "name": "HyperLink",
        "fieldType": "HyperLink",
        "pageNumber": 1,
        "bounds": {
            "x": 50,
            "y": 600,
            "width": 150,
            "height": 50
        },
        "hyperlinkText": "hyperlinkText",
        "value": "https://www.google.com"
    },
     {
      "id": "Attachment",
      "name": "Attachment",
      "fieldType": "Attachment",
      "pageNumber": 1,
      "bounds": {
        "x": 100,
        "y": 100,
        "width": 125,
        "height": 25
      },
      "attachmentInfo": {
        "title": "Attachment title",
        "description": "Please attach the proof",
        "acceptedFileTypes": ["PDF", "DOCUMENT", "IMAGE"]
      }
    }
  ],
  "locale": "EN"
}' \
  -F 'Files=@{your file}' \
var apiClient = new ApiClient("https://api.boldsign.com", "{Your API key}");
var documentClient = new DocumentClient(apiClient);

var documentFilePath = new DocumentFilePath
{
    ContentType = "application/pdf",
    FilePath = "{Your File path}"
};

var filesToUpload = new List<IDocumentFile>
{
    documentFilePath,
};

var hyperlinkField = new FormField(
    id: "Hyperlink",
    isRequired: true,
    type: FieldType.Hyperlink,
    pageNumber: 1,
    hyperlinkText: "Click here",
    value: "https://www.google.com",
    bounds: new Rectangle(x: 400, y: 200, width: 125, height: 25));

var attachmentField = new FormField(
    id: "Attachment",
    isRequired: true,
    type: FieldType.Attachment,
    pageNumber: 1,
    attachmentInfo: new AttachmentInfo(title: "Attachment title", description: "Please attach the proof", acceptedFileTypes: ["PDF", "DOCUMENT", "IMAGE"]),
    bounds: new Rectangle(x: 400, y: 100, width: 125, height: 25));

var formFieldCollections = new List<FormField>()
{
    hyperlinkField,
    attachmentField
};

var signer = new DocumentSigner(
    signerName: "David",
    signerEmail: "david@cubeflakes.com",
    formFields: formFieldCollections,
    locale: Locales.EN);

var documentSigners = new List<DocumentSigner>()
{
    signer
};

var sendForSign = new SendForSign()
{
    Signers = documentSigners,
    Title = "Sample Document",
    Files = filesToUpload
};
var documentCreated = documentClient.SendDocument(sendForSign);
import requests
import json

url = "https://api.boldsign.com/v1/document/send"

signer_data = {
    "name": "David",
    "emailAddress": "david@cubeflakes.com",
    "signerType": "Signer",
    "signerRole": "Signer",
    "formFields": [
        {
        "id": "HyperLink",
        "name": "HyperLink",
        "fieldType": "HyperLink",
        "pageNumber": 1,
        "bounds": {
            "x": 50,
            "y": 600,
            "width": 150,
            "height": 50
        },
        "hyperlinkText": "hyperlinkText",
        "value": "https://www.google.com"
        },
        {
            "id": "Attachment",
            "name": "Attachment",
            "fieldType": "Attachment",
            "pageNumber": 1,
            "bounds": {
                "x": 100,
                "y": 100,
                "width": 125,
                "height": 25
            },
            "attachmentInfo": {
                "title": "Attachment title",
                "description": "Please attach the proof",
                "acceptedFileTypes": ["PDF", "DOCUMENT", "IMAGE"]
            }
        }
    ],
    "locale": "EN"
}

payload = {
    'Signers': json.dumps(signer_data),
    'Title': "Sample Document"
}

files = [
    ('Files', ('{Your file name}', open('{Your file path}', 'rb'), 'application/pdf'))
]

headers = {
    'accept': 'application/json',
    'X-API-KEY': '{Your API key}'
}

response = requests.post(url, headers=headers, data=payload, files=files)

print(response.text)
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const url = "https://api.boldsign.com/v1/document/send";
const signer_data = {
  "name": "David",
  "emailAddress": "david@cubeflakes.com",
  "signerType": "Signer",
  "formFields": [
         {
        "id": "HyperLink",
        "name": "HyperLink",
        "fieldType": "HyperLink",
        "pageNumber": 1,
        "bounds": {
            "x": 50,
            "y": 600,
            "width": 150,
            "height": 50
        },
        "hyperlinkText": "hyperlinkText",
        "value": "https://www.google.com"
    },
    {
      "id": "Attachment",
      "name": "Attachment",
      "fieldType": "Attachment",
      "pageNumber": 1,
      "bounds": {
        "x": 100,
        "y": 100,
        "width": 125,
        "height": 25
      },
      "attachmentInfo": {
        "title": "Attachment title",
        "description": "Please attach the proof",
        "acceptedFileTypes": ["PDF", "DOCUMENT", "IMAGE"]
      }
    }
  ],
  "locale": "EN",
};

const formData = new FormData();
formData.append('Signers', JSON.stringify(signer_data));
formData.append('Title', 'Sample Document');
formData.append('Files', fs.createReadStream('{Your file path}'));

const headers = {
  ...formData.getHeaders(),
  'X-API-KEY': '{Your API}'
};

axios.post(url, formData, { headers })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error);
  });

In the above examples, set the values for value, hyperlinkText, Title, Files, name, and emailAddress. After executing the above code, the document will be created with a hyperlink form field, and an email will be sent to the signer for signing.