Download OpenAPI specification:Download
Integration API for contracting services, sending documents for signature from applications via REST API requests.
Version 1.0 – 1.7: Last update 2017. Upgrading to version 3.0 or higher is recommended. Versions currently not supported. Contact support for help with the migration.
Version 2.0 – 2.3: last update: 2019. Parameters are added to the requests to use more signature, timestamp and contracting possibilities. The online identity verification/certification service via video is added.
Version 2.5: last update: 2020. The possibility to send identity verification in contracts and identifying contract parameters is added.
Version 2.55: Last update: 2021. A utility is added to certify and timestamp, or only timestamp, a PDF document in a simple way. A utility integrable into applications.
Version 3.0: Last update 2021. The API REST format is changed to adapt the systems to the ENS security certification (national security scheme). The possibility to use workflows is added and the customization possibilities are extended. The possibility to add signature boxes in templates and files and other features is included. Migration to this version is recommended. Migration is very simple from 2.0 or higher.
Version 3.1: Last update 2023. The possibility to request documents from signers is added.
In your user account you will find the API User and the API Token, both are necessary to make REST API requests to the API functions. For security, the requests must be made via POST and with the secure HTTPS protocol.
To use Basic Authentication you must include a header in the requests of the type: Authorization: Basic Base64StringAPI where Base64StringAPI is the Base64 encoding of the string APIUser:APIToken, you can find your API User and API Token in your user account at Your Data -> Configure Account.
To generate the Base64 encoded string, simply generate the string APIUser:APIToken and encode it in base64 using any base64encode function.
Empty connections: It is important to bear in mind that a repeatedly erroneous connection will be treated by the system as spam and may end up temporarily blocking the connection.
It is advisable to avoid making repeated connections with erroneous data or quick 'empty' connections (without making sends) with the same data to obtain the number of credits or the same report.
To obtain reports optimally in real time, it is recommended to configure the API in the panel to receive them in a script on your website.
Response of the requests:
Most functions have a parameter called 'Resp'. This parameter defines the format of the response that will be returned. It can be TXT, JSON, XML or undefined.
It is always recommended to define this parameter since all functions, for compatibility with previous versions of the API, respond by default (if this parameter is not defined) as they did in old versions. In these results from previous API versions, some of the variables included in this version of the API are omitted, which we consider important to facilitate integration and account information.
In the included examples it is always assumed that you have defined the parameter. If you are working directly with API version >= 5, we will assume that you have defined the parameter in all requests.
Recommended operation:
The recommended operation, being the simplest and at the same time the most professional, is the following:
- PROCESS 1: Sending the signature request: Described in the /EnviarContrato function of this document.
- PROCESS 2: Automatic reception of signature statuses on your website (process described in the 'Automatic reception of events' section.
HTTP Basic authentication. Use your API User as the username and your API Token as the password (you will find them in your panel, under Your Data → Configure Account). The resulting header is Authorization: Basic base64(APIUser:APIToken). Most HTTP libraries build it automatically (curl -u, requests auth=, Ruby's basic_auth, etc.) without needing to encode the base64 by hand.
basicFunction for sending contracts and configuring them for signature by one or more signers. Definition of the necessary parameters.
ATTENTION: Check the real-time event reception section if you want to receive the status of the contracts and the signer(s) interactions in real time in a script on your website.
| Firmantes required | Array of arrays Example: Firmantes=[{"Nombre":"Pedro Pérez","NIF":"00000000T","Email":"destinatario@eldominio.com"}] JSON array with the data of the signers. In which the following variables must be included:
|
| Flujotrabajo | string Example: Flujotrabajo=238754787 A workflow already saved in your account that you want to reuse. A workflow is created from your user panel when sending contracts for signature, it has predefined the documents, templates, signature type, etc... and it is enough to define the recipients/signers to complete the process. It is very useful in repetitive type contract sends (contract templates such as particular conditions, PDF in general conditions and a SEPA template for example). The use of workflows only adds the defined values if they are not sent in the request, that is, the normal variables, for example TipoFirma, prevail in the request over the one defined in the workflow. Thus, if in the workflow you have defined ACEPTACION as signature mode and it is not defined in the API request, that signature type will be used but, if, for example, in the request you define TipoFirma=BIOMETRICA, this will prevail (be used) over the one defined in the workflow. There are two variables whose behavior is different. DOCUMENTOS and FIRMASEMISOR add the documents and signatures defined both in the workflow and in the request. These parameters are therefore cumulative. |
| Firmasemisor | Array of arrays Example: Firmasemisor=[{"ID":1865998}] JSON array with the sender signatures saved in your account that you want to 'stamp' on the templates and documents sent after the signers' signature. The system, before certification, will add your signature and certificates to the document, completing the legal document. The signature stamping boxes are defined in the documents variable for PDFs and in the creation of templates in the user panel for Templates
|
| Documentos | Array of arrays Example: Documentos=[{"Tipo":"PLANTILLA","PLANTILLA":"120958967","ACEPTACION":"NO"}] JSON array with the list of documents, templates and check boxes that make up the contract or agreement. The parameters to include in the array are:
|
| Documentossolicitados | Array of arrays Example: Documentossolicitados=[{"Texto":"Por favor, cargue o haga una foto del anverso de su DNI","Firmante":"0"}] JSON array with the list of documents requested from one or all signers, you can choose that each signer uploads a different document, that all upload the same one (for example each signer's DNI) or any combination. The parameters to include for each requested document are:
|
| Personalizacion | string Example: Personalizacion={
"Nombre_de_Empresa":”La empresa”,
"CIF":”B800000000”,
"Nombre_Apoderado":”Pedro Fernández”,
"Variable …":”Valor”,
}
JSON array with the customization data of the templates if one or several templates have been added and you want them to be filled in automatically, you must indicate here the values of each variable you want to fill in. The variables of the template(s) that you do not indicate/specify in this parameter must be filled in by the first signer. For example:
|
| Tipofirma | string Enum: 1 2 3 4 Example: Tipofirma=3 It is the signature type that the signers must use. The options are:
|
| Remitente | string Example: Remitente=MiEmpresa Sender of the SMS or Certified SMS sent to perfect the contract. It is what each signer will receive on their mobile as 'message from...'. Generally the name of the issuing company is used. Maximum 11 characters. |
| Mensaje | string Example: Mensaje=MiEmpresa It is the message that will be sent to each signer with the signature link. Variables can be used (those you have sent with each signer) and you must include the tag [LINK] within the message which will be replaced by the signature link. The default value of this parameter (if not specified) is: 'To the Attention of [NOMBRE] with NIF [NIF], as agreed, we send you the contract for your signature. Click on the following link: [LINK] to start the process.' |
| Mediocomunicacion | string Enum: 1 2 3 Example: Mediocomunicacion=EMAIL It is the communication medium that will be used in the signature message.
|
| Tipodocumento | string Example: Tipodocumento=Contrato (Default 'Contrato'). String with the type of contract we are sending. It is what the signer(s) who are going to sign are told. For example it can be 'Settlement agreement', 'Contract', 'SEPA Mandate', 'Insurance claim statement', 'Power of attorney assignment', etc….It does not influence the operation, it is simply what the signers are told. |
| Verificacionidentidad | string Enum: "NO" "SI" Example: Verificacionidentidad=NO (Default NO) if set to 'SI', the system will identify each signer via video and will certify the identification including DNI validity, whether the identified person is real (liveness test) and whether the identified person is the one in the DNI. To do this, the system will make a video of the person to be identified and will ask them to show the DNI to the camera. The DNI data of the first signer can also be used to automatically fill in the templates incorporated in the contract. ATTENTION you must request activation of this service since, for privacy reasons, we must validate the company that is going to use this service. Possible values:
|
| Minparecidoverificacion | integer Example: Minparecidoverificacion=80 It is the minimum similarity between the identified person and their DNI to continue the contract process automatically. In case this threshold is not exceeded or the process has detected some problem (for example Expired DNI) the system will wait for validation in panels to continue with the signature process. You will also automatically receive a request to your report receiving script with all the DNI data and the result and validations. |
| Referenciausuario | string Example: Referenciausuario=NombreFirmante-NombreEmpresa-DNI User reference for the contract. It serves as a user reference (you will receive it within the parameters of the requests to your report reception script) and to conveniently search for each contract in the panels. |
| Accesible | string Enum: "NO" "SI" Example: Accesible=SI Indicates whether each signer will have access to the signed document. Actually they will have access to the final certificate with the signed document.
|
| Alternamedios | string Enum: "NO" "SI" Example: Alternamedios=SI If set to SI, it tells the system to alternate the communication between SMS and Email in each signature reminder until the signers have finished the process. In this way, as long as you have defined the Email and the Mobile Phone of each signer, the system will send signature reminders alternately by SMS and by Email, thus achieving an increase in the contact possibilities if the recipient/signer has a broken mobile, turned off or does not open email.
|
| Recordatorios | integer Example: Recordatorios=3 It is the number of days between signature reminders. If each signer has not finished the process, has left it halfway or has not yet accessed it, the system sends them a reminder every X days to finish the process. The maximum number of reminders is 10, after which the contract will expire unless the date indicated in the FechaLimite parameter is earlier than that number of reminders can be sent. |
| Fechalimite | string Example: Fechalimite=2021-10-10 It is the date on which the system will stop sending reminders if the process has not been finished and will close the contract as unsigned. ATTENTION: The contract will actually expire on any of these events, whichever happens first:
|
| Idioma | string Enum: "es" "pt" "en" Example: Idioma=es It is the language in which the signature process is displayed. If you need one that does not appear, contact us. At this moment the possibilities are:
|
| Minimocheck | integer Example: Minimocheck=1 If you have included CheckBoxes in the documents it is the minimum number of them that each signer must activate (ON) before continuing the process. The utility of Minimum and Maximum for checkboxes could be:
|
| Maximocheck | integer Example: Maximocheck=1 If you have included CheckBoxes in the documents it is the maximum number of them that each signer must activate (ON) before continuing the process. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Firmantes required | Array of any |
| Flujotrabajo | string |
| Firmasemisor | Array of any |
| Documentos | Array of any |
| Documentossolicitados | Array of any |
| Personalizacion | string |
| Tipofirma | string |
| Remitente | string |
| Mensaje | string |
| Mediocomunicacion | string |
| Tipodocumento | string |
| Verificacionidentidad | string |
| Minparecidoverificacion | integer |
| Referenciausuario | string |
| Accesible | string |
| Alternamedios | string |
| Recordatorios | integer |
| Fechalimite | string |
| Idioma | string |
| Minimocheck | integer |
| Maximocheck | integer |
| Resp | string |
{- "Firmantes": "[{\"Nombre\":\"Pedro Pérez\",\"NIF\":\"00000000T\",\"Email\":\"destinatario@eldominio.com\"}]",
- "Flujotrabajo": "238754787",
- "Firmasemisor": "[{\"ID\":1865998}]",
- "Documentos": "[{\"Tipo\":\"PLANTILLA\",\"PLANTILLA\":\"120958967\",\"ACEPTACION\":\"NO\"}]",
- "Documentossolicitados": "[{\"Texto\":\"Por favor, cargue o haga una foto del anverso de su DNI\",\"Firmante\":\"0\"}]",
- "Personalizacion": "string",
- "Tipofirma": "3",
- "Remitente": "MiEmpresa",
- "Mensaje": "MiEmpresa",
- "Mediocomunicacion": "EMAIL",
- "Tipodocumento": "Contrato",
- "Verificacionidentidad": "NO",
- "Minparecidoverificacion": "80",
- "Referenciausuario": "NombreFirmante-NombreEmpresa-DNI",
- "Accesible": "SI",
- "Alternamedios": "SI",
- "Recordatorios": "3",
- "Fechalimite": "2021-10-10",
- "Idioma": "es",
- "Minimocheck": "1",
- "Maximocheck": "1",
- "Resp": "JSON"
}[- {
- "Res": "10",
- "ContratoId": "1994779988",
- "ReportId": "1994779988",
- "Cred": "12000",
- "Firmantes": "2",
- "Documentos": "0"
}
]REAL-TIME RECEPTION OF THE STATUSES OF EACH CONTRACT IN A SCRIPT ON YOUR SERVER.
By activating the option to receive reports in real time in a script on your server from your user panel, you will receive a POST request with the indicated format each time each sent contract changes status.
You can configure receiving the requests with basic authentication and in JSON or FORM-DATA format
Parámetros recibidos en su script en petición POST con la configuración especificada en su panel de usuario/configuración API.
| Servicio required | string Type of report you are receiving (the objective is to distinguish between the reports of the different services). The services referred to in this specification can receive
| ||||||||||||||||||||||||
| ContratoID | string Contract identifier. It is also known as CSV (Secure Verification Code). Once certified, the contract will always be available at https://www.lofirmo.com/csv/{ContratID} (for example: https://www.lofirmo.com/csv/ASYYFRE5492-HN776TFD) | ||||||||||||||||||||||||
| ReportID | integer Unique identifier of all the contract reports. | ||||||||||||||||||||||||
| Resultado required | integer Status of the contract. The possible statuses are:
| ||||||||||||||||||||||||
| FechaEnvio | string Date on which the contract was sent. | ||||||||||||||||||||||||
| FechaFirma | string Date on which the contract was signed. | ||||||||||||||||||||||||
| NumFirmantes required | string Number of signers of the contract. | ||||||||||||||||||||||||
| NumFimados | string Number of signers who have already signed. | ||||||||||||||||||||||||
| Referencia required | string User reference that was sent during the send request. | ||||||||||||||||||||||||
| TipoFirma | integer Signature type that is going to be performed/has been performed. The possible values are:
|
{- "Servicio": "CONTRATACION",
- "ContratoID": "ASYYFRE5492-HN776TFD",
- "ReportID": "299846332",
- "Resultado": "11",
- "FechaEnvio": "2021-10-10 10:10",
- "FechaFirma": "2021-10-10 10:10",
- "NumFirmantes": "2",
- "NumFimados": "1",
- "Referencia": "Su referencia si la indicó",
- "TipoFirma": "3"
}Function that allows forcing the immediate continuation of the signature flow of a contract. Its intended use includes, among other cases, resending the signature request to the next signer who has not yet completed the signature. This operation is subject to a limit of 2 executions per day per signature process. If alternative communication media have been configured and the channel used by default for the previous notification, for example SMS or email, has not been effective, the system will try to resend the signature request using the next available channel. For the use of alternative media to be possible, the signer must have a mobile phone number and email address provided in the send function.
| Contratoid required | string Example: Contratoid=1283876988 ContratoID identifier returned in the send function. |
| Reportid required | integer Example: Reportid=1283876988 ReportID identifier returned in the send function. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Contratoid required | string |
| Reportid required | integer |
| Resp | string |
{- "Contratoid": "1283876988",
- "Reportid": "1283876988",
- "Resp": "JSON"
}[- {
- "Res": "1"
}
]Function to cancel the contract if it is not finalized. Reminders stop being sent and the contract is closed/canceled.
| Contratoid required | string Example: Contratoid=1283876988 ContratoID identifier returned in the send function. |
| Reportid required | integer Example: Reportid=1283876988 ReportID identifier returned in the send function. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Contratoid required | string |
| Reportid required | integer |
| Resp | string |
{- "Contratoid": "1283876988",
- "Reportid": "1283876988",
- "Resp": "JSON"
}[- {
- "Res": "1",
- "Cred": "12000"
}
]Function to obtain the current status of a contract. It is recommended to use the webhook defined previously where you will receive real-time updates of the status changes of the contracts.
| Contratoid required | string Example: Contratoid=1283876988 ContratoID identifier returned in the send function. |
| Reportid required | integer Example: Reportid=1283876988 ReportID identifier returned in the send function. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Contratoid required | string |
| Reportid required | integer |
| Resp | string |
{- "Contratoid": "1283876988",
- "Reportid": "1283876988",
- "Resp": "JSON"
}[- {
- "Res": "1",
- "Estado": "1014",
- "FechaEnvio": "2021-10-10 10:10",
- "FechaFirma": "2021-10-10 10:15",
- "Firmantes": "2",
- "Firmados": "2",
- "Cred": "12000"
}
]Obtaining the PDF file with the certificate of the contract sent via the API. This function is usually executed in response to a report reception with certificate status (example result 1014 -signed and certified- . The PDF file is downloaded directly if the function executes successfully.
| Contratoid required | string Example: Contratoid=1283876988 ContratoID identifier returned in the send function. |
| Reportid required | integer Example: Reportid=1283876988 ReportID identifier returned in the send function. |
| Doc | string Enum: "CERTIFICADO" "FIRMANTE" Example: Doc=CERTIFICADO Type of document to download
|
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Contratoid required | string |
| Reportid required | integer |
| Doc | string |
| Resp | string |
{- "Contratoid": "1283876988",
- "Reportid": "1283876988",
- "Doc": "CERTIFICADO",
- "Resp": "JSON"
}In case of success a PDF file with the contract certificate is downloaded.
Function that returns the number of credits in the account. It is a function of very sporadic use since most functions return in their responses the number of Credits remaining in the user. Therefore, it is usually used simply as a functionality test or to obtain the number of credits occasionally
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
Parameters are sent in the body of the POST request, either as a JSON object (Content-Type application/json, RECOMMENDED) or as an application/x-www-form-urlencoded form. In the form format, array or object parameters are sent as a JSON-encoded string. Parameter names are case-insensitive. The detailed description of each parameter is in the parameters section of this operation.
| Resp | string |
{- "Resp": "JSON"
}[- {
- "Res": "10",
- "Cred": "12000"
}
]