Download OpenAPI specification:Download
Integration API for sending Certified EMAIL messages from your applications through https requests.
In your user account you will find the API User and the API Token; both are required to make the REST API requests to the API functions. For security reasons, requests must be made using POST and the secure HTTPS protocol.
To use Basic Authentication you must include a header in your 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 under Your Data -> Configure Account.
To generate the Base64-encoded string, simply build the string APIUser:APIToken and encode it in base64 using any base64encode function.
Empty connections: Please note that a repeatedly failed connection will be treated by the system as spam and may end up temporarily blocking the connection.
It is advisable to avoid repeated connections with incorrect data, or fast 'empty' connections (without actually sending anything) using the same data just to obtain the number of credits or the same report.
To obtain reports optimally in real time, we recommend configuring the API in your panel to receive them in a script on your website.
Request response:
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.
We always recommend setting this parameter because, for backward compatibility with previous API versions, all functions respond by default (if this parameter is not set) the way they did in older versions. Those older API-version results omit some of the variables included in this API version, which we consider important to ease integration and account information.
The included examples always assume you have set this parameter. If you are working directly with API version >= 5, we will assume you have set the parameter in every request.
Recommended workflow:
The recommended workflow, being both the simplest and the most professional, is as follows:
- PROCESS 1: Sending a Certified EMAIL: Described in the EnviarEMAILCertificado function of this document.
- PROCESS 2: Automatic reception of reports on your website (process described in the 'Reception of delivery reports' 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 Certified Email messages from your applications. Definition of the required parameters.
ATTENTION: Check the real-time report reception section if you want to receive the status of the emails and the recipient's interactions in real time in a script on your website.
| Remitente required | string Example: Remitente=tucorreo@tudominio.com Sender of the Certified Email. It must be a valid email and must have been previously validated in the user control panel. |
| Destinatarios required | Array of arrays Example: Destinatarios=[{"Nombre":"Pedro Pérez","Email":"destinatario@eldominio.com","Variable_1":"Variable to personalize subject and message per recipient"}] JSON array with the recipients of the certified email. You can add variables if you want to personalize the Subject and Message per recipient. For example:
ADVANCED: If you want to protect the notification with OTP, ID document, Certificate, etc.. you must add the following options as variables to each recipient:
|
| Asunto required | string Example: Asunto=Esto es una Notificacion para {{Nombre}} con motivo de {{Variable_1}} The subject of the certified email / of the notification |
| Mensaje required | string Example: Mensaje=A la atención de {{Nombre}} con NIF {{DNI}}, Te enviamos esta notificación ..... Message that will be sent to the recipient(s) |
| Fecha | string Example: Fecha=2022-05-01 15:10 Date on which the sending is scheduled; the message will be sent on that date. Default "", which means send immediately. Format Year-Month-day hour:minute. The time reference is CET/CEST (Spain time zone). |
| Aceptacion | string Enum: "SI" "NO" Example: Aceptacion=NO Parameter used to request explicit acceptance or rejection by the recipient prior to viewing the notification. Options 'SI' or 'NO' (NO by default) |
| Caducidadaceptacion | integer Example: Caducidadaceptacion=10 (Mandatory if Acceptance is enabled) It is the time during which the recipient will be able to accept or reject the notification. After this time, if it has not been accepted or rejected, it will expire. Value from 1 to 30 days |
| Adjuntos | Array of arrays JSON array with the attachments if you want to include them in the message. For example :
|
| Referenciausuario | string Example: Referenciausuario=Tu referencia Parameter used as a reference for the user. If you choose to receive the report at a URL, you will receive this parameter in the result of the sending. |
| Resp | string Enum: "TXT" "JSON" "XML" Example: Resp=JSON Type of response to return as the result of the call.
|
| Report | string Example: Report=0 If you want to receive reports by email or in a script on your website (by enabling the API configuration in the user panel). |
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.
| Remitente required | string |
| Destinatarios required | Array of any |
| Asunto required | string |
| Mensaje required | string |
| Fecha | string |
| Aceptacion | string |
| Caducidadaceptacion | integer |
| Adjuntos | Array of any |
| Referenciausuario | string |
| Resp | string |
| Report | string |
| Res required | integer <int32> Response of the requested function
|
| Error | string In the case of Res -3, you will get a descriptive error of the problem in this parameter. |
| Destinatarios | Array of arrays Recipient data in an array in which idMensaje is added for each recipient. The idMensaje is the identifier of the message or group of messages sent. It serves, for example, as an identification to obtain the report of the sent message (whether the phone has been unsubscribed, delivery times, etc.). It will be received in the requests if you enable real-time report reception in a script on your website/server. |
| Cred | double Credits remaining in the user account after sending. |
| Enviados | integer Number of messages actually sent. |
| NoEnviados | integer Number of erroneous/not sent recipients. |
| Duplicados | integer Number of recipients not sent because they were duplicated. |
| CreditosUsados | integer Number of Credits used. |
{- "Remitente": "tucorreo@tudominio.com",
- "Destinatarios": "[{\"Nombre\":\"Pedro Pérez\",\"Email\":\"destinatario@eldominio.com\",\"Variable_1\":\"Variable to personalize subject and message per recipient\"}]",
- "Asunto": "Esto es una Notificacion para {{Nombre}} con motivo de {{Variable_1}}",
- "Mensaje": "A la atención de {{Nombre}} con NIF {{DNI}}, Te enviamos esta notificación .....",
- "Fecha": "2022-05-01 15:10",
- "Aceptacion": "NO",
- "Caducidadaceptacion": "10",
- "Adjuntos": [
- null
], - "Referenciausuario": "Tu referencia",
- "Resp": "JSON",
- "Report": "0"
}[- {
- "Res": "10",
- "Error": "Falta parámetro obligatorio",
- "Destinatarios": "[{\"Nombre\": \"Pedro Pérez\",\"Email\": \"destinatario@eldominio.com\",\"IDMENSAJE\": \"108366478\",\"Variable_1\": \"Variable para personalizar asunto y mensaje por destinatario\"}]",
- "Cred": "12000",
- "Enviados": "2",
- "NoEnviados": "0",
- "Duplicados": "0",
- "CreditosUsados": "18"
}
]REAL-TIME RECEPTION OF DELIVERY STATUSES IN A SCRIPT ON YOUR SERVER.
By enabling 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 message 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 goal is to distinguish between the reports of the different services). The services referred to in this specification may receive
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Resultado required | integer Status of the notification sent. The possible statuses are:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Remitente required | string Sender used in the sending. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Destinatario required | string Email of the recipient the report refers to. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fecha required | string Date of the report (date on which the carrier serving the destination mobile reports the new status) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Asunto required | string Subject of the sent message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idMensaje required | integer Unique identifier received as a response in the sending function (idMensaje received in the sending function) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Referencia required | string User reference that was sent during the sending request. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CSV | string Secure Verification Code received only if you already have generated certificates |
{- "Servicio": "EMAILCERTIFICADO",
- "Resultado": "11",
- "Remitente": "tucorreo@tudominio.com",
- "Destinatario": "destino@dominio.com",
- "Fecha": "2020-12-03 11:14:24",
- "Asunto": "Asunto del email",
- "idMensaje": "10573758",
- "Referencia": "Su referencia si la indicó",
- "CSV": "ASYYFRE5492HN776TFD"
}Function to cancel a Certified Email previously scheduled via the sending function.
| Idmensaje required | integer Example: Idmensaje=1283876988 Identifier returned by the sending 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.
| Idmensaje required | integer |
| Resp | string |
| Res required | integer <int32> Response of the requested function
|
| Cred | double Credits remaining in the user account after sending. |
{- "Idmensaje": "1283876988",
- "Resp": "JSON"
}[- {
- "Res": "1",
- "Cred": "12000"
}
]Function to reschedule an email previously scheduled via the sending function that was scheduled to be processed in the future..
| Idmensaje required | integer Example: Idmensaje=1283876988 Identifier returned by the sending function. |
| Fecha required | string Example: Fecha=2022-12-03 11:14:24 New sending date. |
| 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.
| Idmensaje required | integer |
| Fecha required | string |
| Resp | string |
| Res required | integer <int32> Response of the requested function
|
| Cred | double Credits remaining in the user account after sending. |
{- "Idmensaje": "1283876988",
- "Fecha": "2022-12-03 11:14:24",
- "Resp": "JSON"
}[- {
- "Res": "10",
- "Cred": "12000"
}
]Obtaining the PDF file with the certificate of the message sent to a mobile via the API. This function is usually executed in response to a report reception with a certificate status (for example, result 14 -delivered and certified- in Certified EMAIL and 17, 160 or 181 -contract signed/perfected and certified- in the case of EMAIL Contract). A report and PDF are downloaded if the Phone is specified, or all recipients of the message if it is not specified.
| Idmensaje required | integer Example: Idmensaje=1283876988 Identifier returned by the sending 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.
| Idmensaje required | integer |
| Resp | string |
{- "Idmensaje": "1283876988",
- "Resp": "JSON"
}In case of success, a zip file is downloaded. Contents of the ZIP: - Certificates in PDF format - CSV file with the result of the certified message to each recipient.
Function to obtain the report of a sent certified email. It is recommended to enable report reception on your website instead of using this function. Looping requests (continuous querying of the status of the same message(s) in a loop) are considered an attack and may block your connection.
| Idmensaje required | integer Example: Idmensaje=1283876988 Identifier returned by the sending 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.
| Idmensaje required | integer |
| Resp | string |
| Res required | integer <int32> Response of the requested function
|
| Programado | string Date on which the message was or will be sent. |
| Remitente | string Sender of the certified email. |
| Destinatario | string Recipient of the certified email. |
| Cred | double Credits remaining in the user account after sending. |
| Estado | integer Current status of the message. |
| txtEstado | string Text description of the message status. |
{- "Idmensaje": "1283876988",
- "Resp": "JSON"
}[- {
- "Res": "10",
- "Programado": "2021-10-10 10:10",
- "Remitente": "tucorreo@tudominio.com",
- "Destinatario": "destinatario@dominio.com",
- "Cred": "12000",
- "Estado": "11",
- "txtEstado": "Mensaje entregado, abierto, leído y certificado"
}
]Function that returns the number of credits in the account. It is a very occasional-use function since most functions return the number of Credits remaining in the user in their responses. Therefore, it is usually used simply as a test of operation 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 |
| Res required | integer <int32> Response of the requested function
|
| Cred required | double Credits remaining in the user account after sending. |
{- "Resp": "JSON"
}[- {
- "Res": "10",
- "Cred": "12000"
}
]