WHATSAPP Sending API (7.0)

Download OpenAPI specification:Download

INTRODUCTION

Integration API for sending WHATSAPP BUSINESS messages from your applications through https requests.

AUTHENTICATION

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.

IMPORTANT NOTES

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 WhatsApp message: Described in the EnviarWHATSAPP function of this document.
- PROCESS 2: Automatic reception of reports on your website (process described in the 'Reception of delivery reports' section).

basicAuth

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.

Security Scheme Type: HTTP
HTTP Authorization Scheme: basic

Send WhatsApp

/EnviarWHATSAPP

Function for sending WhatsApp messages from applications. Definition of the required parameters.

NOTE: You must have your WhatsApp account enabled in your user panel. Also check the real-time report reception section if you want to receive the status of the messages and the recipient's interactions in real time in a script on your website.

Authorizations:
basicAuth
query Parameters
Destinatarios
required
Array of arrays
Example: Destinatarios=[{"Telefono":"34600000001","Nombre":"Pedro Pérez","Email":"recipient@thedomain.com"}]

JSON array with the WhatsApp recipients (Telefono parameter) and their associated variables if you want to personalize. You can add variables to personalize Header, footer, buttons, etc. per recipient. Only the phone is mandatory, plus the template variables when sending that message type; the other variables are added to personalize other message types and must be included in the message sections as {{Variable}} (for example in the header, body or footer of the message) For example:


                  [
                    {
                         \"Telefono\": \"34600000001\",
                         \"Nombre\": \"Pedro Aicart\",
                         \"Email\": \"pedro@dominio.com\"
                         \"idMensajeRespondido\": \"100299924445\"
                     },
                     {
                         \"Telefono\": \"34600000002\",
                         \"Nombre\": \"Ana Aguado\",
                         \"Email\": \"ana@empresa.com\"
                     }
                  ]

At minimum you must provide each recipient phone; you can also include idMensajeRespondido if the message is a direct reply to one you have received. In certain message types such as Reaccion it is mandatory to provide the idMensajeRespondido parameter per recipient, since it is a direct reaction to a received message. The additional Variables (besides Telefono and any variables you include to personalize the DatosMensaje parameter) to include per recipient depend on the message type. NOTE: To send emojis (for example in the "REACCION" message type or anywhere in the text of other message types), you can do it directly with the emoji 😃 or by using UTF-16 codes, for example: \uD83D\uDE01


Plantilla For each recipient you must include the template variables to personalize the message (those written when creating it as {{Nombre}}, {{1}}, etc.).
Texto - You must send the "Texto" parameter per recipient; it can be personalized.
    Texto - The text message for each recipient
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
Imagen - Image message; for each recipient you must include:
    Imagen - URL of the image to send to that recipient
    Descripcion - Text message accompanying the image for that recipient.
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
Documento - Sending a document
    Documento - URL of the document to send
    Descripcion - Text message accompanying the document (may contain per-recipient variables).
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
Ubicacion - Sending a location.
    Latitud - Latitude of the location, for example 40.7522 (dot as decimal separator)
    Longitud - Longitude of the location, for example -3.4562 (dot as decimal separator)
    Nombre - Name of the location
    Direccion - Address of the location
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
SolicitarUbicacion - Requests the recipient location.
    Texto - The text message to send to the recipient to request their location. Example: To send you restaurant suggestions in your area we need your location.
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
Lista - Sends a list of options
    Lista You must include a Lista parameter that is itself an array with ID, Titulo and Descripcion for each list item. This way the list is personalizable per recipient. Example "lista":[{"ID":"1","Titulo":"first","Descripcion":"This is the first"},{"ID":"2","Titulo":"second","Descripcion":"This is the second"},{"ID":"3","Titulo":"third","Descripcion":"This is the third"}]
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
BotonesRespuesta - Sending a list of reply buttons.
    Botones It is an array with ID and Valor for each Button. This way, the button list is personalizable per recipient. Example "Botones":[{"Id":"Id1","Valor":"Button 1"},{"Id":"ident2","Valor":"My second button"}]
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.
Reaccion - Send a reaction to a message received from your customer
    Emoji - Value of the Emoji to send as a reaction to the received message.
    idMensajeRecibido (Required) - Value of the id of the received message you want to react to.
BotonesCTA - Sending a CTA (Click to Action) button
    Boton button text
    Url The URL to which the recipient will be redirected when they tap the button
    idMensajeRecibido (Optional) - Value of the id of the received message if you want the reply to appear related to it.

Tipomensaje
required
string
Enum: "PLANTILLA" "TEXTO" "IMAGEN" "DOCUMENTO" "UBICACION" "SOLICITARUBICACION" "LISTA" "BOTONESRESPUESTA" "REACCION" "BOTONESCTA"
Example: Tipomensaje=Plantilla

Type of message to send. Once you receive a message from a customer or they interact with one of your messages (for example by tapping a button on the template message you sent them), a 24-hour window opens during which you can send that recipient any type of message. Outside that 24-hour window you can only send Template-type messages.
Plantilla - Template message type; you must have created the corresponding template in Meta.
Texto - Text message; you can include variables.
Imagen - Image message
Documento - Sending a document
Ubicacion - Sending a location.
SolicitarUbicacion - Requests the recipient location.
Lista - Sends a list of options
BotonesRespuesta - Sending a list of reply buttons.
Reaccion - Send a reaction to a message received from your customer
BotonesCTA - Sending a CTA (Click to Action) button

Datosmensaje
Array of arrays
Example: Datosmensaje={"Plantilla":"My Template"}

JSON array with the data required for each WhatsApp message type
Plantilla You must include the following parameters in DatosMensaje
    Plantilla - Name of the template you want to send. Note: in the destinatarios parameter you must include, for each recipient, the values of the variables included in the template.
Texto - DatosMensaje does not need additional parameters. The parameters must be included in the Destinatarios array, "Texto" variable personalized per recipient.
Imagen - Image message; does not require elements in the DatosMensaje array
Documento - Sending a document; does not require elements in the DatosMensaje array
Ubicacion - Sending a location; does not require elements in the DatosMensaje array
SolicitarUbicacion - Requests the recipient location; does not require elements in the DatosMensaje array
Lista - Sends a list of options
    Header - Message header. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.
    Body - Message body. Maximum length 1024 characters
    Footer - Message footer. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.
BotonesRespuesta - Sending a list of reply buttons.
    Header - Message header. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.
    Body - Message body. Maximum length 1024 characters
    Footer - Message footer. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.
Reaccion - Send a reaction to a message received from your customer; does not require elements in the DatosMensaje array
BotonesCTA - Sending a CTA (Click to Action) button
    Header - Message header. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.
    Body - Message body. Maximum length 1024 characters
    Footer - Message footer. Maximum length after substituting variables is 60 characters. The system will trim to 60 characters if this limit is exceeded.

Fecha
string
Example: Fecha=2022-05-01 15:10

Date on which the send 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).

Referenciausuario
string
Example: Referenciausuario=Your reference

Parameter used as a reference for the whole campaign on the user side. If you choose to receive the report at a URL, you will receive this parameter in the send result, along with the reference of each recipient if you provided it in the user array.

Report
integer
Example: Report=0

If you want to receive reports in a script on your website (by enabling the API configuration in your user panel). 1 for Yes, 0 for No. Default 0.

Siguientecanal
Array of strings
Fixutf8
integer
Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
ANT - (Deprecated). Kept for backward compatibility with previous versions
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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.

Destinatarios
required
Array of any
Tipomensaje
required
string
Datosmensaje
Array of any
Fecha
string
Referenciausuario
string
Report
integer
Siguientecanal
Array of any
Fixutf8
integer
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


>0 Number of messages sent.
-1 Authentication error.
-2 Not enough credits.
-3 Error in the call data. Required parameters are missing. In this case, you will get an additional parameter called Error with the error description.
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when sending the message.
-6 Error in the WhatsApp template

Error
string

In the case of Res -3, you will get a descriptive error of the problem in this parameter.

idMensaje
integer

Identifier of the sent message.

Cred
double

Credits remaining in the user account after the send.

Enviados
integer

Number of messages effectively sent.

NoEnviados
integer

Number of erroneous/not-sent recipients.

Request samples

Content type
{
  • "Destinatarios": "[{\"Telefono\":\"34600000001\",\"Nombre\":\"Pedro Pérez\",\"Email\":\"recipient@thedomain.com\"}]",
  • "Tipomensaje": "Plantilla",
  • "Datosmensaje": "{\"Plantilla\":\"My Template\"}",
  • "Fecha": "2022-05-01 15:10",
  • "Referenciausuario": "Your reference",
  • "Report": "0",
  • "Siguientecanal": [
    ],
  • "Fixutf8": 0,
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

Set Typing Status

/TypingWHATSAPP

Function that lets you set the typing status in WhatsApp; this way, while you reply, the recipient will see that you are typing.

Authorizations:
basicAuth
query Parameters
Idmensaje
required
integer
Example: Idmensaje=1288177432

Identifier of the message you are replying to or are going to reply to. The IdMensaje is the identifier you obtain in the message reception webhook

Telefono
required
string
Example: Telefono=34600000000

Phone number from which the message was received and which you are replying to.

Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
ANT - (Deprecated). Kept for backward compatibility with previous versions
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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
Telefono
required
string
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


>0 Success.
-1 Authentication error.
-3 Error in the call data. Required parameters are missing. In this case, you will get an additional parameter called Error with the error description.
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when processing the request.
-6 Error in the process

Error
string

In the case of Res -3, you will get a descriptive error of the problem in this parameter.

Cred
double

Credits available in the account

Request samples

Content type
{
  • "Idmensaje": "1288177432",
  • "Telefono": "34600000000",
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

Download a file or media received in a message

/DescargarFicheroWHATSAPP

Function that lets you download image files, audio, PDFs, etc. received from your customers.

Authorizations:
basicAuth
query Parameters
Idmensaje
required
integer
Example: Idmensaje=1288177432

Identifier of the message in which you received the file or media

Telefono
required
string
Example: Telefono=34600000000

Phone number from which the message was received. You must include the prefix.

Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
ANT - (Deprecated). Kept for backward compatibility with previous versions
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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
Telefono
required
string
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


If successful direct download of the file.
-1 Authentication error.
-3 Error in the call data. Required parameters are missing. In this case, you will get an additional parameter called Error with the error description.
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when processing the request.
-6 Error in the process

Error
string

In the case of Res -3, you will get a descriptive error of the problem in this parameter.

Cred
double

Credits available in the account

Request samples

Content type
{
  • "Idmensaje": "1288177432",
  • "Telefono": "34600000000",
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

Change WhatsApp Status

/CambiarEstadoWHATSAPP

Function that lets you change the status of your WhatsApp account. Note that the change is not immediate. It may take seconds to be validated in Meta, or several minutes if it does not pass Meta/Facebook's first validation.

Authorizations:
basicAuth
query Parameters
Estado
required
string
Example: Estado=I'm using WhatsApp Business with Mensatek

New status of your WhatsApp account. Up to 1024 characters.

Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
ANT - (Deprecated). Kept for backward compatibility with previous versions
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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.

Estado
required
string
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


>0 Success.
-1 Authentication error.
-3 Error in the call data. Required parameters are missing. In this case, you will get an additional parameter called Error with the error description.
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when processing the request.
-6 Error in the process

Error
string

In the case of Res -3, you will get a descriptive error of the problem in this parameter.

Cred
double

Credits available in the account

Request samples

Content type
{
  • "Estado": "I'm using WhatsApp Business with Mensatek",
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

List WhatsApp Templates

/GetPlantillasWHATSAPP

Returns the list of templates (message templates) of your WhatsApp Business account, indexed by idPlantilla. For each template it returns its name, language, category, current status in Meta (APPROVED, PENDING, REJECTED, DISABLED, PAUSED, ...) and a Verificada indicator that equals 1 when the status is APPROVED (i.e. the template is approved by Meta and can be used to send messages to your recipients).

This function is the first step of the flow to send a Template-type message via API: with the idPlantilla you obtain here you can then query the expected variables using the GetVariablesPlantillaWhatsapp function, and then call EnviarWHATSAPP with TIPOMENSAJE=Plantilla passing the template name in DATOSMENSAJE.PLANTILLA and the variables in DESTINATARIOS.

Authorizations:
basicAuth
query Parameters
Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


1 Success, template list returned in the Plantillas parameter.
-1 Authentication error.
-3 Error in the call data.
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when querying the templates.

Total
integer <int32>

Total number of templates returned in the Plantillas parameter.

Plantillas
object

Object whose keys are the idPlantilla of your account and each value an object with the following fields:


Nombre - Name of the template. It is the value you must pass in DATOSMENSAJE.PLANTILLA when calling EnviarWHATSAPP.
Idioma - Language code of the template (es, en_US, pt_BR, ...).
Categoria - Category of the template in Meta: MARKETING, UTILITY or AUTHENTICATION.
Estado - Current status in Meta. Typical values: APPROVED, PENDING, REJECTED, DISABLED, PAUSED.
Verificada - 1 if the status is APPROVED (the template can be used to send messages); 0 otherwise.
FormatoParametros - POSITIONAL if the variables go in order ({{1}}, {{2}}, ...) or NAMED if the template uses named variables ({{Nombre}}, {{Producto}}, ...).

Error
string

In the case of a negative Res, you will get a descriptive error of the problem in this parameter.

Cred
double

Credits available in the account

Request samples

Content type
{
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

Variables of a WhatsApp Template

/GetVariablesPlantillaWHATSAPP

Returns the variables that a specific template expects in order to be personalized correctly when sent. It receives the idPlantilla as input (as returned by GetPlantillasWhatsapp) and returns a Variables object indexed by variable number, with the variable name, where it appears within the template (header, body or buttons) and the expected format of the value (text, image URL, document URL, etc.).

Variable 1 is always the Destinatario (Campo=Telefono, Formato=TELEFONO), corresponding to the phone of the customer you are going to send the message to. The rest of the variables are the ones you defined when creating the template in Meta (placeholders {{1}}, {{2}}, ... or {{Nombre}} if you use the NAMED format) plus the special variables that Meta requires for image/document/video headers or for URL buttons.

When calling EnviarWHATSAPP with TIPOMENSAJE=Plantilla, you must pass inside DESTINATARIOS, for each recipient, a value for each variable using the name indicated in the Campo field (preferred) or in Nombre.

Authorizations:
basicAuth
query Parameters
Idplantilla
required
string
Example: Idplantilla=572863982585983

Numeric identifier of the template whose variables you want to query. You obtain it from the keys of the Plantillas object returned by /GetPlantillasWhatsapp.

Resp
string
Enum: "TXT" "JSON" "XML"
Example: Resp=JSON

Type of response to return as the result of the call.
JSON - The response will be returned in JSON
XML - The response will be returned in XML
TXT - The response will be returned in Text format

Request Body schema:

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.

Idplantilla
required
string
Resp
string

Responses

Response Schema:
Array
Res
required
integer <int32>

Response of the requested function


1 Success, variables returned in the Variables parameter.
-1 Authentication error.
-3 Error in the call data (includes the case of IDPLANTILLA not existing in the account).
-4 You have not configured WhatsApp Business in your user account.
-5 Meta/Facebook error when querying the templates.

IdPlantilla
string

Identifier of the queried template (the same IDPLANTILLA passed as input).

Nombre
string

Name of the template. It is the value you must pass in DATOSMENSAJE.PLANTILLA when calling EnviarWHATSAPP.

Idioma
string

Language code of the template.

Categoria
string

Category of the template in Meta: MARKETING, UTILITY or AUTHENTICATION.

Estado
string

Current status of the template in Meta (APPROVED, PENDING, REJECTED, DISABLED, PAUSED).

Verificada
integer <int32>

1 if the status is APPROVED (the template can be used), 0 otherwise.

FormatoParametros
string

POSITIONAL if the variables go in order ({{1}}, {{2}}, ...) or NAMED if the template uses named variables ({{Nombre}}, {{Producto}}, ...).

Total
integer <int32>

Total number of variables returned in the Variables parameter (including variable 1 "Destinatario").

Variables
object

Object whose keys are the variable number (1, 2, 3, ...) and each value an object with the following fields:


Nombre - Readable name of the variable (it is the original placeholder {{Nombre}} of the template, or a description if it is a special variable: 'Header IMAGE', 'Button 0 Code Value', ...).
Campo - Internal name with which you must send the value in each recipient when calling EnviarWHATSAPP. It is the stable identifier of the variable and the one you should preferably use. For body variables it matches Nombre; for special variables (image/video/document headers, URL buttons, copy code, promo code, flow token) it is an identifier of the type Variable_Cabecera_image, Valor-URL-Boton-0, etc.
Donde - Section of the template where the variable appears: empty for variable 1 (Destinatario/phone), HEADER, BODY or BUTTONS.
Formato - Expected format of the value you must send. Possible values:
    TELEFONO Recipient phone number, with international prefix without '+' or spaces (always variable 1).
    TEXTO Any text string (substitutes {{x}} placeholders in a text header, body or buttons).
    URL_IMAGEN Absolute public URL to a JPG/PNG/GIF image for an image-type header.
    URL_DOCUMENTO Absolute public URL to a PDF or Office file for a document-type header.
    URL_VIDEO Absolute public URL to an MP4 for a video-type header.
    URL Public URL for a URL button parameter.
    CODIGO Short code for Copy Code or Promo Code buttons.
    FLOW_TOKEN Optional token for Flow buttons (leave 'unused' if you do not use it).
    UBICACION Descriptive text (address / location name) for LOCATION-type headers.
Ejemplo - Sample value consistent with the Formato to help with integration.

Error
string

In the case of a negative Res, you will get a descriptive error of the problem in this parameter.

Cred
double

Credits available in the account

Request samples

Content type
{
  • "Idplantilla": "572863982585983",
  • "Resp": "JSON"
}

Response samples

Content type
[
  • {
    }
]

Reception of delivery reports and status changes of sent WhatsApp messages, and reception of incoming messages

https://{YourDomain}/path/to/your/report/reception/script

REAL-TIME DELIVERY OF STATUS CHANGES OF SENT AND RECEIVED MESSAGES TO 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 every time a sent message changes status, or when you receive a message or a reply to your messages.

You can configure the requests to be received with basic authentication and in JSON or FORM-DATA format.

Authorizations:
basicAuth
Request Body schema:

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

WHATSAPP If the service refers to a WHATSAPP report

Direccion
required
string

Type of report you are receiving (the goal is to distinguish between reports of incoming and outgoing messages).

INPUT If the message is incoming/a message has been received OUTPUT If the report is about the status of a sent message

Estado
required
integer

Status of the sent or received message. The possible statuses are:

STATUS DESCRIPTION MEANING
`8` Received The message has been received.
`9` Message read Meaning: Message received and marked as read.
`10` Sent Meaning: The message has been sent, awaiting delivery.
`11` Message Delivered Meaning: The message has been delivered.
`12` The recipient has read the message Meaning: The recipient has read the message.
`29` Message Cancelled Meaning: The message was cancelled by the user before it was sent.
`50` Rejected by Facebook Meaning: Facebook has rejected the message; review the reason and retry.
`51` No WhatsApp Meaning: The recipient does not have WhatsApp, and no alternative channel was specified to deliver the message.
`52` Resent through another channel Meaning: It was resent through another channel because the recipient does not have WhatsApp
`55` Could not be sent. There is an error in sending the message.
`56` No credit in Meta. You have no credit in Meta. You must access your Meta account and add a bank card.
`900` Sent via SMS Meaning: The recipient does not have WhatsApp and it was sent via SMS.
`901` Sent via RCS Meaning: The recipient does not have WhatsApp and it was sent via RCS.
`902` Sent via Voice Meaning: The recipient does not have WhatsApp and it was sent via Voice.
`903` Sent via Email Meaning: The recipient does not have WhatsApp and it was sent via Email.
`1000` Delivered to Facebook Meaning: The message has been accepted for delivery by Facebook/Meta.
`1001` Scheduled Meaning: The message is scheduled to be sent later.
`1002` Sending Meaning: The message is being sent.
`1003` Retrying Meaning: There was a problem at the destination; the system is retrying.
Telefono
required
string

Phone number of the recipient (or of the sender if it is a received message) the report refers to.

NombreDestinatario
required
string

Name of the WhatsApp profile the message is sent to or received from.

Fecha
required
string

Report date

idMensaje
required
integer

Unique identifier received as a response in the send function (idMensaje received in the send function)

Referencia
required
string

User reference that was sent during the send request.

Tipo
required
string

Type of the sent or received message. They are the message types indicated in the 'Send' function

Mensaje
string

Received message, only available when Direccion=INPUT

Request samples

Content type
{
  • "Servicio": "WHATSAPP",
  • "Direccion": "INPUT",
  • "Estado": "8",
  • "Telefono": "34600000001",
  • "NombreDestinatario": "Pedro Pérez",
  • "Fecha": "2020-12-03 11:14:24",
  • "idMensaje": "10573758",
  • "Referencia": "Your reference if you provided it",
  • "Tipo": "text",
  • "Mensaje": "{\"type\":\"text\",\"text\":\"This is the message you have received\"}"
}