NAV

eSignTools API v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This document describes how to send a document for signature to eSignTools. Based on REST principles, our Web API return data in JSON .

See an example of a Java implementation.

A document which will be signed is also called "agreement".

The classic workflow is :

The document is now sent for signature to the recipients.

eSignTools will call the callback each time an event occurs.

Example, if the callback is set to https://mysite.com/event :

About signature fields

There are currently 3 ways to manage signature fields. You can either put it yourself in the PDF before uploading it to eSignTools, or you can add them dynamically at the upload.

Postman Collection detailing the 3 methods to create an agreement

Method 1 : Upload a PDF already containing signature fields :

These fields shall have a name like SignatorySignature_X_Y, where X is the recipent position (set in CreateRecipientDTO) and Y the fields number.
Examples :

Example Document

Method 2 : Using tags

Your PDF can have no signature field, but just text tags. Add anywhere in your document a text #signatureX# to add a signature field linked to the recipient with position=X.

Example :

The signature fields will have a default size. You can customize the size in the API.

Example Document

Method 3 : Upload a PDF without signature fields

If your PDF does not contain any signature fields, you must define them in the call to the API. For each recipient, you must have at least one signature field. See CreateSignatureZoneDTO

A signature field is defined by :

Example Document

About document types

Instead of uploading a PDF file, you can upload any file with one of the following extension : .rtf, .doc, .docx, .xls, .xlsx, .odt, .ods The document will be converted by eSignTools into a PDF.

Base URLs:

Authentication

Authentication

Authenticate

POST /v1/authenticate

Authenticate with eSignTools API and returns a JWT Token. This token must be sent to every other request in the Authorization bearer header. Example : "Authorization: Bearer XXX" where XXX is the token returned by this method.

Body parameter

{
  "password": "string",
  "rememberMe": true,
  "username": "string"
}

Parameters

Name In Type Required Description
body body Credentials true eSignTools Credentials

Example responses

200 Response

{
  "authorities": [
    "string"
  ],
  "id_token": "string"
}

Responses

Status Meaning Description Schema
200 OK OK JWTToken
201 Created Created None
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Agreement Resource

Basic interactions necessarry to handle the agreement through it's lifetime

Create a new agreement

POST /signing/v1/agreements

Body is a FormData composed of a document (sent in binary) and a CreateAgreementDTO object (serialized as a JSON) to create an agreement.
For examples, see the Postman collection in the introduction.

Body : composed of two multipart/form-data fields

pdf: binary data
agreement: JSON format data

Parameters

Name In Type Required Description
body body object true Body with the format multipart/form-data
» pdf body binary true The source document
» agreement body string true String containing a CreateAgreementDTO in json format

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK AgreementDTO
201 Created Created None
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Re-send the mail to the recipient

GET /signing/v1/agreements/{agreementId}/send-mails

Parameters

Name In Type Required Description
agreementId path integer(int64) true ID of the document

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK boolean
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Agreements settings

GET /signing/v1/agreements/{id}

Get information about the agreement in JSON format.

Parameters

Name In Type Required Description
id path integer(int64) true ID of the eSignTools agreement to get the settings.

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK AgreementDTO
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Delete an agreement

DELETE /signing/v1/agreements/{id}

The agreement must not be signed. It will be deleted and the recipient(s) will not be able to sign it.

Parameters

Name In Type Required Description
id path integer(int64) true ID of the eSignTools agreement to delete.

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK string
204 No Content No Content None
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None

Download the document

GET /signing/v1/agreements/{id}/current-file

The document can be downloaded at any point of the process. (Unsigned, Partially Signed, Signed)

Parameters

Name In Type Required Description
id path integer(int64) true ID of the eSignTools document

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK byte
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Downloads the proof PDF

GET /signing/v1/agreements/{id}/proof

Parameters

Name In Type Required Description
id path integer(int64) true ID of the eSignTools document

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK byte
401 Unauthorized Unauthorized None
403 Forbidden Forbidden None
404 Not Found Not Found None

Schemas

Credentials

{
  "password": "string",
  "rememberMe": true,
  "username": "string"
}

Credentials

Properties

Name Type Required Restrictions Description
password string true none Password of the API user
rememberMe boolean false none none
username string true none Username of the API user

JWTToken

{
  "authorities": [
    "string"
  ],
  "id_token": "string"
}

JWTToken

Properties

Name Type Required Restrictions Description
authorities [string] false none none
id_token string false none JWT Token to pass to next API calls.

CreateAgreementDTO

{
  "callbackUrl": "https://mysite.com/event",
  "defaultFieldHeight": 0,
  "defaultFieldWidth": 0,
  "name": "Contract123",
  "recipients": [
    {
      "canRenew": true,
      "email": "string",
      "fields": [
        {
          "height": 0,
          "page": 0,
          "width": 0,
          "x": 0,
          "y": 0
        }
      ],
      "firstname": "string",
      "lastname": "string",
      "phone": "string",
      "position": 0,
      "step": 0
    }
  ],
  "reminderDelay": "86 400",
  "textTemplateName": "default"
}

CreateAgreementDTO

Properties

Name Type Required Restrictions Description
callbackUrl string false none URL which will be called when an event occurs. See the Introduction to know how callback events works.
defaultFieldHeight integer(int32) false none Set the default height of signature fields when using tags.
defaultFieldWidth integer(int32) false none Set the default width of signature fields when using tags.
name string true none Name of the agreement
recipients [CreateRecipientDTO] true none none
reminderDelay integer(int32) false none Set the delay of reminders in minutes. A reminder is sent when a recipient has not signed the document. If this parameter is not set, no reminder will be sent.
textTemplateName string false none Template to use when a mail is sent to the recipient. If this parameter is not set, the default template is used.

CreateRecipientDTO

{
  "canRenew": true,
  "email": "string",
  "fields": [
    {
      "height": 0,
      "page": 0,
      "width": 0,
      "x": 0,
      "y": 0
    }
  ],
  "firstname": "string",
  "lastname": "string",
  "phone": "string",
  "position": 0,
  "step": 0
}

CreateRecipientDTO

Properties

Name Type Required Restrictions Description
canRenew boolean false none none
email string true none none
fields [CreateSignatureZoneDTO] false none List of the signature fields to add for this recipient. This list is mandatory if the PDF does not contain any signature fields.
firstname string true none none
lastname string true none none
phone string false none Phone number of the recipient. If this propery is set, a SMS with a code will be sent to the recipient to validate its signature.
position integer(int32) false none Position of the concerned Signature Form in the PDF. Example : if the position is 1, every Signature Form with the name SignatorySignature_1_x will be bound to this recipient. This property is optional if you set the signature fields via the API. Default is 1
step integer(int32) false none Step of this recipient in the signature workflow. If every recipient has step=1, the document will be sent for signature simultaneously to every recipient. If step=1 for recipient A and step=2 for recipient B, eSignTools will wait A to sign before sending it to B. Default is 1

CreateSignatureZoneDTO

{
  "height": 0,
  "page": 0,
  "width": 0,
  "x": 0,
  "y": 0
}

CreateSignatureZoneDTO

Properties

Name Type Required Restrictions Description
height integer(int32) false none Height of the field in points
page integer(int32) false none Number of the page which will contain the field (starts with 1)
width integer(int32) false none Width of the field in points
x integer(int32) false none Horizontal position of the field, from the left of the page, in points
y integer(int32) false none Vertical position of the field, from the bottom of the page, in points

AgreementDTO

{
  "currentStep": 0,
  "estClientUrlAccess": "string",
  "id": 0,
  "name": "string",
  "pages": 0,
  "recipients": [
    {
      "canRenew": true,
      "email": "string",
      "firstname": "string",
      "id": 0,
      "lastname": "string",
      "status": "WAITING",
      "step": 0
    }
  ],
  "renewedDate": "2019-08-24T14:15:22Z",
  "status": "OPEN"
}

AgreementDTO

Properties

Name Type Required Restrictions Description
currentStep integer(int32) false none Current step of the document. See CreateAgreementDTO::step
estClientUrlAccess string false none none
id integer(int64) false none Agreement ID generated by eSignTools
name string false none Name of the agreement (ex : "Contract")
pages integer(int32) false none Number of pages of the document
recipients [RecipientStatusDTO] false none [Information about the recipient and its status in the signature workflow.]
renewedDate string(date-time) false none none
status string false none Current status of the agreement.
- OPEN : the document has not been signed by all recipients
- CLOSED : the document is signed by every recipient and is archived
- ABORTED : the document has been rejected by a recipient
- DELETED : the document has been deleted with a DELETE API call
- ABANDONED : the document is expired

Enumerated Values

Property Value
status OPEN
status CLOSED
status ABORTED
status DELETED
status ABANDONED

RecipientStatusDTO

{
  "canRenew": true,
  "email": "string",
  "firstname": "string",
  "id": 0,
  "lastname": "string",
  "status": "WAITING",
  "step": 0
}

RecipientStatusDTO

Properties

Name Type Required Restrictions Description
canRenew boolean false none none
email string false none none
firstname string false none none
id integer(int64) false none ID of the recipient, generated by eSignTools
lastname string false none none
status string false none none
step integer(int32) false none See CreateRecipientDTO:step for more details.

Enumerated Values

Property Value
status WAITING
status SIGNED
status REFUSED