Integration Guide
Signer is a web portal of documents that enables digital and electronic signatures as well as the creation of complex document flows. This guide presents the integration options so that your application can make the most of Signer's potential.
If this is your first integration, start with Getting started, which takes you from zero to your first signed document in about 15 minutes. This guide serves as a reference for the use cases.
Authentication
All API calls demand one API Key in order to communicate with Signer. This key must be placed in the header of all requests:
X-Api-Key: your-application|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Every API Key is associated with an Organization previously registered in Signer. Therefore, the scope of this key is restricted to that organization, that key will only allow you to access/create documents from that same organization.
To get an API key: if you have permission to create applications in the organization, create an application under Applications and generate the key with its Keys button, as shown in Getting started. Otherwise, ask your instance administrator for one.
Client libraries
Lacuna publishes a client library of the API for .NET, Java, Node.js and PHP. You create the client with the URL of your Signer instance and the API key, and call the APIs through its methods. You can also call the REST API directly from any language, as Getting started does with curl.
| Language | Package | Version | Install |
|---|---|---|---|
| .NET (.NET Framework 4.5 or later, .NET Standard 2.0) | Lacuna.Signer.Client | 1.24.0 | dotnet add package Lacuna.Signer.Client |
| Java | com.lacunasoftware.signer:signer-client | 2.14.0 | Gradle: implementation 'com.lacunasoftware.signer:signer-client:2.14.0' |
| Node.js | signer-node-client | 1.1.0 | npm install signer-node-client |
| PHP | lacuna/signer-client | 1.4.10 | composer require lacuna/signer-client |
The samples on GitHub use these libraries, with one scenario per use case of this guide. To embed the signing screen in your web page, use the lacuna-signer-widget JavaScript library: see Embedded signature.
How the flow works
In practice, an integration with Signer follows four stages. Each stage has a dedicated page in this guide:
- Create documents: upload the file, assemble the participant flow and (optionally) sign inside your own application.
- Track documents: check the status, send reminders and receive webhook notifications.
- Download and list: get the document versions and list documents by different criteria.
- Validate signatures: validate signatures using a validation key or the signed file.
And throughout the document's life you may need lifecycle operations: cancel, refuse, pause and resume, submit a new version, delete or restore.
Use cases
| Use case | What you do |
|---|---|
| Create documents | Upload, flow creation, embedded signature, pre-positioning signatures and envelopes (multiple files) |
| Document field reference | Look up the participant fields, the identifier types and the participant and document options |
| Track documents | Check document and participant status, send reminders and set up webhooks |
| Download and list | Download the different document versions and list documents |
| Validate signatures | Validate signatures by key or by signed file |
| Document lifecycle | Cancel, refuse, pause and resume, submit a new version, delete and restore |
| Contacts and identifiers | Manage the organization's contacts and a user's identifiers |
Error responses
The APIs answer with these HTTP status codes:
| Code | Meaning |
|---|---|
200 (OK) | Request processed. The response body depends on the API: see its entry in the API reference. |
400 (Bad Request) | Syntax error, for instance a required field that was not sent. |
401 (Unauthorized) | The API key was not sent or is invalid. |
403 (Forbidden) | The API key is valid, but its application does not have permission for the requested operation. |
422 (Unprocessable Entity) | API error, for instance an entity ID that is not found. The body is an ErrorModel. |
An ErrorModel has three fields:
| Field | Type | Content |
|---|---|---|
code | string | The error code. Test this field in your code, not the message. |
message | string | A description of the error. |
details | object, with string values | Additional information about the error. It may be null. |
{
"code": "DocumentNotFound",
"message": "...",
"details": null
}
The API reference lists the main codes of a 422 response: CertificateNotFound, DocumentNotFound, FolderNotFound, CpfMismatch, CpfNotExpected, InvalidFlowAction and DocumentInvalidKey. The list is not comprehensive, and new codes may be added at any time without notice, so handle codes you do not know. Other pages describe the codes of their operations, such as DocumentHasNoSignatures when downloading a version.