EasySign API - Generate signature request link

The following article describes information about the Generate an EasySign signature request link API call.

URL

/api/sign/generate-request

Method

POST

Required URL Parameters

Customer-id (string)

Data Parameters

The following describe required and optional data parameters.

NameTypeDescription
apiVersionstringThe API version. This document specifies apiVersion 2.
apiKeystringThe API key for the provided environment.
participantsarrayDescribes the participants of the entire signature workflow. For a detailed description, see the Participants section below.
stepsarrayDescribes the steps of the signature workflow, which participants take part in each step, and which communication entries (SMS, Emails) are sent. For a detailed description, see the Steps section below.
documentsarrayDescribes the PDF documents to be filled or signed during the entire workflow. For a detailed description, see the Documents section below.
NameTypeDescription
requestIdstringReplaces EasySend’s auto generated requestId.
This can be useful for
using an ID from some existing organizational system, to make it easier to connect the EasySend signature session with the originating system session, or for
making sure requests are idempotent. Subsequent calls using an already used request id will fail.
expiryDatestringFor Example: 2008-09-15T15:53:00.
customDataanyAny custom data provided by the API caller. This data is replied when EasySend is sending data to a callback API upon document submission.
consentPopupobjectDescribes information about a consent popup that should be displayed before the form is presented for signature. If omitted, no consent popup is displayed. For a detailed description, see the Consent Dialog Section.
mailingPopupobjectDescribes information about a mailing popup that should be displayed before the form is presented for signature. If omitted, no consent popup is displayed. For a detailed description, see the Mailing Dialog Section.
redirectUrlstringRedirects the browser of the client’s browser will be to the set URL upon completion of the signing.
businessGroupstringIf provided, this will be used for filtering in agent dashboard screen.
If not provided, the value will be ‘Signature Tool’.

Participants Section

This part of the request describes the participants of the signature workflow.
It is a JSON array, containing JSON objects. Each object corresponds to a specific participant (person) that takes part in the signature workflow and has the following structure:

NameTypeDescription
idstringAn internal identifier for this participant. This will be referenced by other areas of the API in order to refer to this participant.

Please make sure to choose a unique identifier for each participant of a specific session.
namestringThe name of the participant (person). This will be used for embedding in communication messages
(SMS/emails).
rolestringAn internal name describing the role for this participant. Each role can be assigned with different permissions for editing different fields of the document/s.
For a specific role, some fields can either be:
Readable/Writable
Read Only
None/Omitted (no read or write).

Steps Section

This section describes the steps of the signature workflow, which participants take part in each step, and which communication entries (SMS/emails) are sent.
It is a JSON array, containing JSON objects. Each object corresponds to one step of a sequential workflow. Only once a specific step is completed, the next step is started.
Each entry of the array is a JSON object of the following structure:

NameTypeDescription
communicationobjectDescribes the set of communication messages (SMS/emails) to be sent for different participants of the workflow. For a detailed description, see the Communication Subsection.
idstring, optionalAn internal identifier for this step. If omitted, EasySend will auto generate a random identifier.
authProviderobject, optionalProvided if this step requires authentication before showing the document signing experience.
Common use cases are:
This step requires a password.
This step should be authenticated using a token provided as a URL parameter.

This step requires a One Time Password (OTP) authentication. An OTP will be sent to the participant’s phone when opening the link.
This step requires authentication with credentials validated via a web service.

Contact EasySend for more information about your specific use case.

Communications Subsection

This subsection describes the set of communication messages (texts / emails) to be sent for different participants of the workflow. It is a JSON object with the following structure:

NameTypeDescription
startarrayAn array of Communication Entry objects, to be sent at the beginning of the step (when sending a link to relevant participants at the beginning of the step.

For a detailed description, see the Communication Entry.
finisharrayAn array of Communication Entry objects, to be sent at the end of the step (when sending a summary of the current step to relevant participants after participants of a specific step have submitted the documents).

For a detailed description, see the Communication Entry.

Communications Entry

All communication entries contain at least these common fields:

NameTypeDescription
participantIdstringThe ID of the participant as specified in the Participants Section.
typestringOne of the following preset values:
email - For sending an email
sms - For sending a text message
none - Will not send any message, only generate a link and return it via API.

Type "email"

For type “email” these additional fields need to be provided:

NameTypeDescription
emailstringThe target email address. It is also supported to:
use a comma separated list of emails in the string value.

Reference a model field (entries not containing the “@” sign will be considered as references to model fields).
subjectstringThe subject of the email. May include special field.

For a detailed description, see the
Escape Sequences for Communication Entries.
bodystringThe content of the email as an HTML string. This may include special fields.

For a detailed description, see the
Escape Sequences for Communication Entries.
attachModelJsonboolean, optional(Only relevant for the “finish” phase) Specifies whether an additional file should be attached to the email. Containing the data fields collected by the tool in a JSON format (in addition to the PDF document).

This is used for cases where an integration expects to receive the data via email once the process is submitted.
customModelJsonFileNamestring, optional(Only relevant for the “finish” phase and only if attachModelJson is set to true). Customizes the file name of the attached model file.
encryptPDFwithPasswordstring, optionalIf provided, PDF will be protected with a password (when you open it, you’ll be prompted to type a password). This field’s content will be used as a password for the encrypted PDF.

Type "sms"

For type “sms” these additional fields need to be provided:

NameTypeDescription
phonestringThe phone number to deliver the SMS/text message to. This must include an international prefix (must start with the plus sign ‘+’).

The content of the text message may include special fields.

For a detailed description, see the
Escape Sequences for Communication Entries.

Escape Sequences

Escape Sequences for Communication Entries:

NameTypeDescription
{{name}}stringThe name of the participant as described in the Participants Section.
{{link}}stringThe link used to start the signature process. (Only available in “start” of step).

Documents Section

This section describes the PDF documents to be filled or signed during the entire workflow.
It is a JSON array containing JSON objects, each object corresponds to a single document, and has the following structure:

NameTypeDescription
titlestringThe title of the document
fileobjectDescribes the content of the PDF document to be signed.
For additional description, see the
File Descriptor Syntax section.
fieldsDetectionTypestringOne of the following preset values:
autoDetect
whiteOnWhiteDetect
selfAssignedDetect
idstring, optionalA unique string representing the document’s id. If omitted, EasySend will auto generate a random id.

Additional Information For Detection Modes

When using the White on White and Self Assigned modes additional fields are required as a part of the document object.

White on White

NameTypeDescription
linkedIdsarrayAn array of objects, containing an two fields:
id - referencing the ID encoded for the field in the PDF document.
value - specifying more information about the field. For a detailed description, see the Field Descriptor Syntax section.

Self Assigned

NameTypeDescription
docFieldsarray of arraysAn array containing an additional array for every page of the document.
Each element of the inner array is structured according to Field Descriptor Syntax.

For a detailed description, see the Field Descriptor Syntax section.

File Descriptor Syntax

All file descriptors contain at least the type field:

NameTypeDescription
typestringOne of the following preset values:
url - used for sending the file using a publicly available URL.

s3 - used for fetching the file from a public / private Amazon S3 bucket.

base64 - used for providing the entire PDF document encoded in base64 as a part of the request.

URL

For type “url” these additional field must be provided:

NameTypeDescription
urlstringA publicly accessible url containing the PDF document.

s3

For type “s3” these additional fields must be provided:

NameTypeDescription
bucketstringThe name of the Amazon Web Services S3 Bucket containing the PDF document.
pathstringPath for the document inside this Amazon Web Services S3 Bucket.

📘

Note

If the bucket is not publicly accessible, EasySend will need to configure an AWS user account for accessing the bucket. Please contact EasySend’s support team for setting this up.

base64

For type “base64” these additional fields must be provided:

NameTypeDescription
datastringThe base64 encoded content of the PDF document.

Field Descriptor Syntax

The field descriptor syntax is used to describe fields on top of the PDF document (either
encoded inside the PDF itself, or under the “linkedIds” object).
The object may contain these fields:

NameTypeDescription
typestringCan be one of these values:

- signature
- text
- xMarker (used for checkboxes, or multiple choice fields)
- signDate (used to show a read only date of another ‘bound’ signature field)
defaultValuestringAllows the API call to provide an initial value for the field, that can later be edited by the user.

The type of defaultValue is determined according to the type of the field:

For “text” - defaultValue should be a string.

For “xMarker” - defaultValue should be a string if the field is a multiple choice field, and boolean if the field is a checkbox field.

For “signature” - defaultValue shouldn’t be used.
rolestring, optionalSpecifies the role of participant the should fill in this field. If no role is specified, any participant is allowed to fill this field.
validationsarray of stringsSpecifies a list of validations that need to be applied on top of the field.
The list of validations available for usage is defined in the EasySend builder.
translateXnumber, optionalReceives values between -100 to 100. Move the position of the field to the right (positive value) or left (negative value). The value is relative in percentages of the page width.
translateYnumber, optionalReceives values between -100 to 100. Move the position of the field to the bottom (positive value) or top (negative value). The value is relative in percentages of the page height.
overrideWidthnumber, optionalReceives values between 0 to 100. Override the field width with the provided value. The value is relative in percentages of the page width.
overrideHeightnumber, optionalReceives values between 0 to 100. Override the field height with the provided value. The value is relative in percentages of the page height.
idstring, optionalThe id of the field, EasySend will auto generate a random id if omitted.
requiredboolean, optionalSpecifies whether the field is required or not (defaults to false).

text Field

Additional option for “text” field:

NameTypeDescription
multilineboolean, optionalIf set to true, creates a multi line input field.

xMarker Field

Additional option for “xMarker” field:

NameTypeDescription
groupValuestring, optionalIf provided, the field will be used as a multi option field (radio question).
In this case separate fields should be defined for every option, each
should be assigned with a different group value. The grouping is done according to the id of the field.
If groupValue is omitted, the field will be used as a checkbox, and
will have a boolean (true/false) value.

signDate Field

Additional option for “signDate” field:

NameTypeDescription
forFieldstringThe id of the bound signature field. The signDate field will display the date when the signature was actually filled.

Consent Dialog Section

NameTypeDescription
displayAtstringOne of these preset values:
none - will not show a consent dialog, and ignore all other options
linkOpen - opens the dialog when the link is opened, before the document signing begins.
titlestringThe text to show in the title of the dialog.
bodystringThe text to show in body of the dialog.
directionstring, optionalOne of these preset values:
ltr (left to right) - default
rtl (right to left)
checkboxTextstringThe text to show near the checkbox
consentIdstring, optionalAn id for identifying the status of consent for the current request. If omitted, EasySend will generate a random identifier.
buttonTextstring, optionalText for button in bottom of dialog.
additionalTextstring, optionalAdditional text paragraph next to the checkbox.

📘

Note

Both title, body and checkboxText support markdown text for embedding links, and styled text. (https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
Links always open in a new browser tab.

Mailing Dialog Section

NameTypeDescription
displayAtstringOne of these preset values:
none - will not show a dialog, and ignore all other options
linkOpen - opens the dialog when the link is opened, before the document signing begins.
titlestringThe text to show in the title of the dialog.
bodystringThe text to show in the body of the dialog.
directionstring, optionalOne of these preset values:
ltr (left to right) - default
rtl (right to left)
checkboxTextstringThe text to show near the checkbox.
buttonTextstringText for button in bottom of dialog.
emailListarray of stringsthe list of emails options that will be able to be selected in the popup.

Document Read Confirmation Section

NameTypeDescription
displayAtstringOne of these preset values:
none - will not show a dialog, and ignore all other options
linkOpen - opens the dialog when the link is opened, before document signing begins.
directionstring, optionalOne of these preset values:
ltr (left to right) - default
rtl (right to left)
checkboxTextstring, optionalThe text to show near the checkbox, if not provided will use a default value.
buttonTextstring, optionalText for button in bottom of dialog, if not provided will use a default value.
readConfirmationIdstring, optionalAn id for identifying the status of read confirmation for the current request. If omitted, EasySend will generate a random identifier.

📘

Note

checkboxText supports markdown text for embedding links, and styled text. (https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
Links always open in a new browser tab.

Auto-Reminder

The Auto-Reminder is a feature that helps sends a reminder of the processes that have not yet been signed and sent back. The auto reminder is added under the “Start” area in the specific “Participant ID“ Communication.

📘

Note

Only support version 2 EasySend API

NameTypeDescription
typestringThe commination output channel for the auto reminder:
email, SMS, or both.
countdownTriggerstringThe type of event that triggers the count down of sending the Auto-Reminder: linkSent or linkOpend
subjectstringThe title of the email or SMS
bodystringThe body of the email or SMS
whenToSendobjectThe time trigger countdown in minutes or days, if minutes two fields are required: type - numOfMinutes, minutes - how many minutes to countdown, if days two fields are required: type - daysAndTime, days - how many days to countdown, time - what is the exact time to send the auto-reminder (configured by 24H UTC)

Sample Calls

The following call uses a White on White field detection mode, the type is url, and the Link to the document is sent via email.

{
    "version": "2",
    "title": "test10_v2",
    "apiKey": "easysend-test",
    "participants": [
        {
            "id": "agent",
            "name": "The agent",
            "role": "admin"
        },
        {
            "id": "customer1",
            "name": "test customer",
            "role": "signer"
        },
        {
            "id": "customer2",
            "name": "The customer",
            "role": "signer"
        }
    ],
    "steps": [
        {
            "communication": {
                "start": [
                    {
                        "participantId": "customer1",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Documents to sign for {{name}}",
                        "body": "hi customer: {{name}}, here is your link: {{link}}"
                    },
                    {
                        "participantId": "agent",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Documents to sign for {{name}}",
                        "body": "hi agent: {{name}}, here is your link: {{link}}"
                    }
                ],
                "finish": [
                    {
                        "participantId": "customer1",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Done",
                        "body": "hi {{name}}, Thanks for submitting!"
                    }
                ],
                "autoReminders": [
                    {
                        "participantId": "customer1",
                        "type": "email",
                        "countdownTrigger": "linkSent",
                        "subject": "A kind reminder for {{name}}",
                        "body": "hi customer: {{name}}, here is your link reminder: {{link}}",
                        "whenToSend": {
                            "type": "numOfMinutes",
                            "minutes": 1
                        },
                        "maxNumOfSends": 1
                    },
                    {
                        "participantId": "customer1",
                        "type": "email",
                        "countdownTrigger": "lastOpened",
                        "subject": "Another kind reminder for {{name}}",
                        "body": "hi customer: {{name}}, here is your link reminder: {{link}}",
                        "whenToSend": {
                            "type": "daysAndTime",
                            "days": 2,
                            "time": "10:00"
                        },
                        "maxNumOfSends": 1
                    }
                ]
            }
        },
        {
            "communication": {
                "start": [
                    {
                        "participantId": "customer2",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Documents to sign for {{name}}",
                        "body": "hi customer: {{name}}, here is your link: {{link}}"
                    }
                ],
                "finish": [
                    {
                        "participantId": "customer2",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Done",
                        "body": "hi {{name}}, Thanks for submitting!"
                    },
                    {
                        "participantId": "agent",
                        "type": "email",
                        "email": "[email protected]",
                        "subject": "Done",
                        "body": "hi {{name}}, Your client has submittied the PDF"
                    }
                ]
            }
        }
    ],
    "documents": [
        {
            "fieldsDetectionType": "whiteOnWhiteDetect",
            "file": {
                "type": "url",
                "url": "https://s3.amazonaws.com/easysend-signature-dev/a.pdf"
            }
        }
    ]
}

The following call uses a auto detect field detection mode, the type is url, and the Link to the document is sent via email.

{
    "version": "2",
    "apiKey": "ExampleEasySendDemoEnvApiKey",
    "customData": "Example Request 1",
    "participants": [
        {
            "id": "customer",
            "name": "John Smith",
            "role": "customer"
        }
    ],
    "communication": {
        "start": [
            {
                "participantId": "customer",
                "type": "email",
                "email": "{{email}}",
                "subject": "Your form is waiting for signature",
                "body": "Hello {{name}}, <br> Please find below the link to your form. <br><br> <a href='{{link}}'>Click here for your form</a><br><br> Please sign the form and submit it. <br> Thank You!"
            }
        ],
        "finish": [
            {
                "participantId": "customer",
                "type": "email",
                "email": "{{email}}",
                "subject": "You form has been submitted",
                "body": "Hello {{name}}, <br> Please find a copy of the signed form attached to this email."
            }
        ]
    },
    "documents": [
        {
            "id": "9a12f15c-f75b-4a53-b7d1-c2856ef3f036",
            "title": "test Document",
            "fieldsDetectionType": "autoDetect",
            "file": {
                "type": "url",
                "url": "https://easysend-static-assets.s3.us-east-1.amazonaws.com/demo-assets/signature-tool/Example%202%20-%20Field%20Annotations.pdf"
            }
        }
    ]
}

Success Responses

Success/ failure will be determined by the HTTP status code in the response.
200 means success in which case the body of the response is:

{
	"links": {
		// You’ll receive a link for every role according to the roleId in participants
    "agent": "the link for starting the form filling experience",
      "customer": "the link for starting the form filling experience"
},
	"requestId": "the request id as provided by request, or generated by EasySend if omitted in request"
}

Error Responses

A status code 400 means a failure has occurred. In this case, the body will contain:

{
	"errorCode": <a number representing the EasySend error code>
	"description": <a textual error description>
}

Code: 403 Forbidden
Content Example:

Error: An invalid api key was provided

📘

Note

EasySign has a download PDF capability. For additional information, please contact our support team.


What’s Next

To view and use API references use the following link: