fbpx
Search
Close this search box.
Search
Close this search box.

< / >

APIs WhatsApp

2. WhatsApp API for sending templates En

URL:

https://wv{{wolkvox_server}}.wolkvox.com/api/v2/whatsapp.php?api=send_template_official

Description:

API for sending mass campaigns through HSM templates

Benefit:

This API allows sending campaigns and mass messages through HSM templates previously approved by Meta, which correspond to a WhatsApp Business line or Cloud API, from an external application.

How it works:

  • The consumption of this API is done by POST method.
  • In the json the parameters are added according to the operation or process to be performed.
  • To consume this API you must replace in the url {{{wolkvox_server}} by the nomenclature of the server of the operation.
  • The wolkvox-token header must be used to make use of the authorization token.
  • Note that the same token cannot be consumed simultaneously, so you can schedule the next API to be consumed when the result of the previous one is successful.
REQUEST
NAME DESCRIPTION TYPE
connector_id Refers to the identifier number of the mobile whatsapp connector created for the line. String
telephone This is the cell phone number to which the message will be sent. String
template_name Template name String
template_vars Variables String
customer_id Customer identification number String
url_attach Refers to the public URL where the image is hosted String
RESPONSE
NAME DESCRIPTION TYPE
code Error code Int
error Name of error String
msg Explanation of error String
Posibles códigos de respuesta
				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL =&gt; 'https://wv{{wolkvox_server}}.wolkvox.com/api/v2/whatsapp.php?api=send_template_official',
  CURLOPT_RETURNTRANSFER =&gt; true,
  CURLOPT_ENCODING =&gt; '',
  CURLOPT_MAXREDIRS =&gt; 10,
  CURLOPT_TIMEOUT =&gt; 0,
  CURLOPT_FOLLOWLOCATION =&gt; true,
  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =&gt; 'POST',
  CURLOPT_POSTFIELDS =&gt;'{
    "connector_id": "1",
    "telephone": "9319xxxxxx",
    "template_name": "my_template",
    "template_vars": "var1;var2;var3",
    "customer_id": "110xxxx03",
    "url_attach": ""
}',
  CURLOPT_HTTPHEADER =&gt; array(
    'wolkvox-token: {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
				
			

RESPONSE

				
					{
    "code": 201,
    "error": null,
    "msg": "Message has been sent successfully"
}
				
			

Hacemos uso de cookies, si continúas navegando asumiremos que estás de acuerdo. Puede leer más sobre el uso de cookies en nuestras políticas de privacidad y tratamiento de datos personales

Hacemos uso de cookies, si continúas navegando asumiremos que estás de acuerdo. Puede leer más sobre el uso de cookies en nuestras políticas de privacidad y tratamiento de datos personales