Crear Plantilla
curl --request POST \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": true,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [
{}
],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"allowChangeCategory": true
}
}
'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
payload = {
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": True,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [{}],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": True,
"codeExpirationMinutes": 45,
"allowChangeCategory": True
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: '<string>',
elementName: '<string>',
template: '<string>',
isVisible: true,
params: [{param: '<string>', label: '<string>', example: '<string>'}],
paramsNumber: 123,
displayName: '<string>',
mediaUrl: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
phone_number: '<string>',
example: '<string>'
}
],
header: '<string>',
exampleHeader: '<string>',
headerParams: [{}],
example: '<string>',
extraSettings: {
addSecurityRecommendation: true,
codeExpirationMinutes: 45,
allowChangeCategory: true
}
})
};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '<string>',
'elementName' => '<string>',
'template' => '<string>',
'isVisible' => true,
'params' => [
[
'param' => '<string>',
'label' => '<string>',
'example' => '<string>'
]
],
'paramsNumber' => 123,
'displayName' => '<string>',
'mediaUrl' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'phone_number' => '<string>',
'example' => '<string>'
]
],
'header' => '<string>',
'exampleHeader' => '<string>',
'headerParams' => [
[
]
],
'example' => '<string>',
'extraSettings' => [
'addSecurityRecommendation' => true,
'codeExpirationMinutes' => 45,
'allowChangeCategory' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
payload := strings.NewReader("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": [
"<string>"
],
"status": "<string>",
"data": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Plantillas
Crear Plantilla
Crea una nueva plantilla HSM y envíala a WhatsApp para aprobación
POST
/
v1
/
bots
/
{botId}
/
templates
Crear Plantilla
curl --request POST \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": true,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [
{}
],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"allowChangeCategory": true
}
}
'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
payload = {
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": True,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [{}],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": True,
"codeExpirationMinutes": 45,
"allowChangeCategory": True
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: '<string>',
elementName: '<string>',
template: '<string>',
isVisible: true,
params: [{param: '<string>', label: '<string>', example: '<string>'}],
paramsNumber: 123,
displayName: '<string>',
mediaUrl: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
phone_number: '<string>',
example: '<string>'
}
],
header: '<string>',
exampleHeader: '<string>',
headerParams: [{}],
example: '<string>',
extraSettings: {
addSecurityRecommendation: true,
codeExpirationMinutes: 45,
allowChangeCategory: true
}
})
};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '<string>',
'elementName' => '<string>',
'template' => '<string>',
'isVisible' => true,
'params' => [
[
'param' => '<string>',
'label' => '<string>',
'example' => '<string>'
]
],
'paramsNumber' => 123,
'displayName' => '<string>',
'mediaUrl' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'phone_number' => '<string>',
'example' => '<string>'
]
],
'header' => '<string>',
'exampleHeader' => '<string>',
'headerParams' => [
[
]
],
'example' => '<string>',
'extraSettings' => [
'addSecurityRecommendation' => true,
'codeExpirationMinutes' => 45,
'allowChangeCategory' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
payload := strings.NewReader("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": [
"<string>"
],
"status": "<string>",
"data": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Crea plantillas HSM personalizadas con parámetros de posición, botones interactivos y medios. Opcionalmente, envía la plantilla directamente a WhatsApp para aprobación.
POST /v1/bots/{botId}/templates
Las plantillas deben ser aprobadas por el equipo de WhatsApp antes de poder usarlas. Sigue las pautas de Meta para evitar rechazos.
Parámetros de ruta
| Propiedad | Tipo | Descripción |
|---|---|---|
| botId | string | ID único del bot. Ejemplo: 123456789 |
Parámetros de consulta
| Propiedad | Tipo | Descripción |
|---|---|---|
| sendToAprove | boolean | Define si la plantilla debe ser enviada a WhatsApp para su aprobación. |
Cuerpo de la solicitud
| Propiedad | Tipo | Descripción |
|---|---|---|
| category | string | Categoría de la plantilla HSM. Valores: UTILITY, MARKETING, AUTHENTICATION |
| language | string | Idioma de la plantilla. |
| isVisible | boolean | Define si la plantilla debe ser mostrada a los operadores. |
| params | array | Estructura de parámetros. Para la categoría de autenticación, Meta ha restringido a un parámetro. |
| paramsNumber | number | Número de parámetros. Para la categoría de autenticación, Meta ha restringido a un parámetro. |
| elementName | string | Identificador único de la plantilla. Solo puede contener letras minúsculas, guiones bajos (_) y números. |
| displayName | string | Nombre para mostrar de la plantilla. |
| template | string | Cuerpo de la plantilla. Para la categoría de autenticación, Meta ha restringido el contenido. |
| type | string | Tipo de HSM. Valores: HSM, IMAGE, VIDEO, DOCUMENT |
| mediaUrl | string | URL del medio. Requerido cuando el tipo de HSM es IMAGE, VIDEO, DOCUMENT. No aplicable para la categoría de autenticación. |
| interactiveAction | string | Acción interactiva del HSM. Valores: NONE, CALL_TO_ACTION, QUICK_REPLY, OTP |
| buttons | array | Estructura del botón. Requerido cuando la acción interactiva del HSM es CALL_TO_ACTION, QUICK_REPLY o OTP. |
| header | string | Encabezado de la plantilla. Aplicable solo para plantillas de tipo texto. No aplicable para la categoría de autenticación y tiene un límite de 60 caracteres. |
| exampleHeader | string | Ejemplo del encabezado. Obligatorio solo si la plantilla tendrá un encabezado. |
| headerParams | array | Estructura de parámetros. El encabezado admite un máximo de un parámetro. |
| example | string | Ejemplo de la plantilla. Si la plantilla tiene un parámetro, este debe ser reemplazado con un ejemplo. |
| extraSettings | object | Configuraciones opcionales para la plantilla. |
Ejemplos de solicitud
Texto
Texto
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_texto_utility",
"template": "Gracias por tu pedido, {{1}}! Tu número de confirmación es {{2}}. Si tienes alguna pregunta, contacta a soporte.",
"example": "Gracias por tu pedido, María! Tu número de confirmación es 71936. Si tienes alguna pregunta, contacta a soporte.",
"elementName": "plantilla_texto_utility",
"params": [
{"param": "1", "label": "cliente", "example": "María"},
{"param": "2", "label": "orden", "example": "71936"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "es",
"category": "UTILITY",
"interactiveAction": "NONE"
}'
Texto con botones de respuesta rápida
Texto con botones de respuesta rápida
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_quick_reply",
"template": "Gracias por tu pedido, {{1}}! Tu número de confirmación es {{2}}. Usa los botones para contactarnos.",
"example": "Gracias por tu pedido, María! Tu número de confirmación es 57893. Usa los botones para contactarnos.",
"elementName": "plantilla_quick_reply",
"params": [
{"param": "1", "label": "cliente", "example": "María"},
{"param": "2", "label": "orden", "example": "57893"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "es",
"category": "UTILITY",
"interactiveAction": "QUICK_REPLY",
"buttons": [
{"text": "Contactar Soporte", "type": "QUICK_REPLY"},
{"text": "Contactar Ventas", "type": "QUICK_REPLY"}
]
}'
Texto con botones CTA
Texto con botones CTA
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_call_action",
"template": "Gracias por tu pedido, {{1}}! Tu número de confirmación es {{2}}. Usa los botones para contactarnos.",
"example": "Gracias por tu pedido, María! Tu número de confirmación es 67996. Usa los botones para contactarnos.",
"elementName": "plantilla_call_action",
"params": [
{"param": "1", "label": "cliente", "example": "María"},
{"param": "2", "label": "orden", "example": "67996"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "es",
"category": "UTILITY",
"interactiveAction": "CALL_TO_ACTION",
"buttons": [
{"text": "Contactar Soporte", "type": "URL", "url": "https://apps.jelou.ai", "example": "https://apps.jelou.ai"},
{"text": "Llamar", "type": "PHONE_NUMBER", "phone_number": "+PHONE_NUMBER"}
]
}'
Imagen
Imagen
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_imagen",
"template": "Hola {{1}}. Te invitamos a conocer nuestras promociones.",
"example": "Hola María. Te invitamos a conocer nuestras promociones.",
"elementName": "plantilla_imagen",
"params": [
{"param": "1", "label": "cliente", "example": "María"}
],
"paramsNumber": 1,
"type": "IMAGE",
"language": "es",
"category": "MARKETING",
"mediaUrl": "https://cdn.ejemplo.com/imagen.jpeg",
"interactiveAction": "NONE"
}'
Documento
Documento
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_documento",
"template": "Hola {{1}}. Adjuntamos tu documento solicitado.",
"example": "Hola María. Adjuntamos tu documento solicitado.",
"elementName": "plantilla_documento",
"params": [
{"param": "1", "label": "cliente", "example": "María"}
],
"paramsNumber": 1,
"type": "DOCUMENT",
"language": "es",
"category": "MARKETING",
"mediaUrl": "https://cdn.ejemplo.com/documento.pdf",
"interactiveAction": "NONE"
}'
Video
Video
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "plantilla_video",
"template": "Hola {{1}}. Mira nuestro nuevo video.",
"example": "Hola María. Mira nuestro nuevo video.",
"elementName": "plantilla_video",
"params": [
{"param": "1", "label": "cliente", "example": "María"}
],
"paramsNumber": 1,
"type": "VIDEO",
"language": "es",
"category": "MARKETING",
"mediaUrl": "https://cdn.ejemplo.com/video.mp4",
"interactiveAction": "NONE"
}'
Respuestas
200 - Respuesta exitosa
200 - Respuesta exitosa
{
"message": ["Template has been created."],
"status": "success",
"data": {
"template": "¡Hola! Somos *Jelou*. \nTe damos la bienvenida _{{1}}_. Pronto {{2}} del equipo se comunicará contigo.",
"displayName": "Bienvenida",
"elementName": "test_hsm_api",
"params": [
{"label": "Nombre del cliente", "param": "1"},
{"label": "Nombre del asesor", "param": "2"}
],
"paramsNumber": 2,
"isVisible": false,
"language": "ES",
"createdAt": "2021-01-28T15:08:38.492Z",
"updatedAt": "2021-01-28T15:08:38.492Z",
"botId": "BOT_ID",
"companyId": 100,
"status": "APPROVED"
}
}
400 - Bad Request
400 - Bad Request
{
"message": ["Template name already exists"],
"status": "failed"
}
401 - Unauthorized
401 - Unauthorized
{
"message": "Authentication failed"
}
404 - Not Found
404 - Not Found
{
"message": ["The Bot could not be found at the moment."],
"statusMessage": "failed",
"error": {
"code": "E1019",
"key": "BOT_NOT_FOUND"
}
}
El campo
status en la respuesta indica si tu plantilla ha sido aprobada por WhatsApp.Idioma
El idioma soportado por WhatsApp está detallado en la página oficial. Por favor, revísalo cuidadosamente en el siguiente enlace.Restricciones de contenido (Categoría de Autenticación)
Meta ha restringido el contenido para la categoría de autenticación. El contenido será según el idioma de la plantilla. Meta está restringido a un solo parámetro.Idioma
| Idioma | Código | Contenido |
|---|---|---|
| Inglés | en | {{1}} is your verification code. |
| Portugués (BR) | pt_BR | Seu código de verificação é {{1}}. |
| Español | es | Tu código de verificación es {{1}}. |
Estructura de los parámetros
Usa la siguiente estructura en el campo deparams al crear una plantilla:
[
{"label": "Nombre del cliente", "param": "1"},
{"label": "Número de orden", "param": "2"}
]
Estructura del botón
Utiliza la siguiente estructura en el campo debuttons cuando las acciones interactivas sean CALL_TO_ACTION, QUICK_REPLY o OTP.
QUICK_REPLY
Se utiliza para obtener respuestas rápidas. Es un arreglo de objetos y puede tener un máximo de 3 botones.| Propiedad | Descripción |
|---|---|
| text | Texto del botón, este valor no puede ser actualizado. |
| type | Tipo de botón. Valor: QUICK_REPLY |
[
{"text": "Más información", "type": "QUICK_REPLY"},
{"text": "Hablar con operador", "type": "QUICK_REPLY"},
{"text": "Ventas", "type": "QUICK_REPLY"}
]
CALL_TO_ACTION
Se utiliza para ofrecer una llamada a la acción. Puede tener un máximo de 2 botones y un máximo de 1 botón de cada tipo.| Propiedad | Descripción |
|---|---|
| text | Texto del botón, este valor no puede ser actualizado. |
| type | Tipo de botón. Valores: PHONE_NUMBER, URL |
| phone_number | Número de teléfono del botón. |
| url | URL del botón. |
| example | Ejemplo de la URL. Requerido cuando el tipo de botón es URL. |
[
{"text": "Ventas", "phone_number": "+PHONE_NUMBER", "type": "PHONE_NUMBER"},
{"type": "URL", "text": "Ver sitio", "url": "https://apps.jelou.ai/{{1}}", "example": "https://apps.jelou.ai/ofertas"}
]
OTP
Se utiliza para obtener una “Contraseña de un solo uso” (One Time Password). Puede tener un máximo de 1 botón.| Propiedad | Descripción |
|---|---|
| text | Texto del botón, este valor no puede ser actualizado. |
| type | Tipo de botón. Valor: OTP |
[
{"text": "COPY CODE", "type": "OTP"}
]
Estructura de extraSettings
| Propiedad | Tipo | Descripción |
|---|---|---|
| addSecurityRecommendation | boolean | Añade un mensaje de seguridad adicional en las plantillas de autenticación. |
| codeExpirationMinutes | number | Añade un mensaje en el pie de página con el tiempo de expiración del código. Valores entre 1 y 90 minutos. |
| allowChangeCategory | boolean | Permite que Meta actualice la categoría de la plantilla si es necesario. |
Autorizaciones
Basic authentication using Base64 encoded clientId:clientSecret
Parámetros de ruta
Parámetros de consulta
Cuerpo
application/json
Opciones disponibles:
UTILITY, MARKETING, AUTHENTICATION Pattern:
^[a-z0-9_]+$Show child attributes
Show child attributes
Opciones disponibles:
HSM, IMAGE, VIDEO, DOCUMENT Opciones disponibles:
NONE, CALL_TO_ACTION, QUICK_REPLY, OTP Show child attributes
Show child attributes
Maximum string length:
60Show child attributes
Show child attributes
¿Esta página le ayudó?
⌘I