This tutorial shows you how to define hyperlinks on your document with the API.

Use Case Description

In case you want to send a document with one to many URLs to other websites it could be better for the recipient to just click on the links and another tab in the browser opens with the correct website instead of continuously copy paste the links to open them.

Integration

Please be aware that the hyperlink text will not appear on the PDF it will just link to the configured target link. Hence, if you want to display specific text or the Uri (target link) itself in the PDF, make sure to insert the text already before inserting the hyperlink.


To define hyperlinks on the document you have to do the following steps:

  • Upload a document (PDF)
  • Configure the hyperlink(s) in the workstep configuration
  • Send the envelope

After uploading the document you now have to configure the hyperlink(s) in the workstep configuration.

Generally you can define the following settings for links:

  • ElementId
  • Uri (target link)
  • DocumentNumber
  • FieldDefinition
    • Position
      • PageNumber
      • Position (x and y)
    • Size
      • Width
      • Height

You can find a sample configuration of two hyperlinks in the following section:


{
    "Documents": [{
            "FileId": "2b70d99d-1234-1234-b339-724485b70e05",
            "DocumentNumber": 1
        }
    ],
    "Name": "Test",
    "Activities": [{
            "Action": {
                "Sign": {
                    "RecipientConfiguration": {
                        "ContactInformation": {
                            "Email": "janedoe@sample.com",
                            "GivenName": "Jane",
                            "Surname": "Doe",
                            "LanguageCode": "EN"
                        }
                    },
                    "Elements": {
                        "LinkConfiguration": {
                            "HyperLinks": [{
                                    "ElementId": "FirstLink",
                                    "Uri": "https://www.esignanywhere.net",
                                    "DocumentNumber": 1,
                                    "FieldDefinition": {
                                        "Position": {
                                            "PageNumber": 1,
                                            "X": 370,
                                            "Y": 707
                                        },
                                        "Size": {
                                            "Width": 152,
                                            "Height": 15
                                        }
                                    }
                                }, {
                                    "ElementId": "SecondLink",
                                    "Uri": "https://demo.esignanywhere.net",
                                    "DocumentNumber": 1,
                                    "FieldDefinition": {
                                        "Position": {
                                            "PageNumber": 1,
                                            "X": 320,
                                            "Y": 675
                                        },
                                        "Size": {
                                            "Width": 160,
                                            "Height": 15
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "SigningGroup": "firstSigner"
                }
            }
        }, {
            "Action": {
                "SendCopy": {
                    "RecipientConfiguration": {
                        "ContactInformation": {
                            "Email": "johndoe@sample.com",
                            "GivenName": "John",
                            "Surname": "Doe",
                            "LanguageCode": "EN"
                        }
                    }
                }
            }
        }
    ]
}

Please see also the next video: