Skip to main content
POST
/
whatsapp
/
{phoneNumberId}
/
template
Header con documento PDF
curl --request POST \
  --url https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template \
  --header 'Content-Type: application/json' \
  --header 'x-ib-api-key: <api-key>' \
  --data '
{
  "to": "",
  "name": ""
}
'
import requests

url = "https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template"

payload = {
"to": "",
"name": ""
}
headers = {
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '', name: ''})
};

fetch('https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '', name: ''})
};

fetch('https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const url = 'https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template';
const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '', name: ''})
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
HttpResponse<String> response = Unirest.post("https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"\",\n \"name\": \"\"\n}")
.asString();
using RestSharp;


var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"to\": \"\",\n \"name\": \"\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
using RestSharp;


var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"to\": \"\",\n \"name\": \"\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template"

payload := strings.NewReader("{\n \"to\": \"\",\n \"name\": \"\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-ib-api-key", "<api-key>")
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))

}
require 'uri'
require 'net/http'

url = URI("https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-ib-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"\",\n \"name\": \"\"\n}"

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template",
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([
'to' => '',
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ib-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"to\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template")
.post(body)
.addHeader("x-ib-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()

val response = client.newCall(request).execute()
false
import Foundation

let parameters = [
"to": "",
"name": ""
] as [String : Any?]

let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])

let url = URL(string: "https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData

let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
$headers=@{}
$headers.Add("x-ib-api-key", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.insuranceboosters.com/api/v1/whatsapp/{phoneNumberId}/template' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"to": "",
"name": ""
}'
{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "<string>",
      "wa_id": "<string>"
    }
  ],
  "messages": [
    {
      "id": "<string>"
    }
  ]
}
{
"error": "Missing Recipient Phone Number (to)."
}
{
"message": "Invalid API key."
}
{
"error": "Phone line not found"
}
{
"error": "Internal server error"
}
Guía de Enviar plantilla · Tipos de plantilla Cuando la plantilla tiene un header de tipo documento, envía la URL pública del PDF y, opcionalmente, el nombre del archivo. El playground se precarga con la estructura de components. Completa la URL pública (HTTPS), filename, to, name y language antes de enviar.
El link debe ser una URL pública accesible (HTTPS). filename es el nombre que verá el destinatario al descargar el archivo.

Authorizations

x-ib-api-key
string
header
required

API key emitida por Insurance Boosters.

Path Parameters

phoneNumberId
string
required

Identificador de tu línea de WhatsApp. Solicítalo con tu ejecutivo de cuenta.

Example:

"123456789012345"

Body

application/json
to
string
required

Teléfono del destinatario en formato E.164 (solo dígitos, sin +). Ejemplo México: 5215512345678.

name
string
required

Nombre exacto de la plantilla aprobada.

language
string
default:es

Código de idioma de la plantilla. Por defecto es.

Example:

"es"

components
(Encabezado (header) · object | Cuerpo (body) · object | Botón (button) · object)[]

Componentes dinámicos (header, body, button). Omitir o enviar [] si la plantilla no tiene variables.

inactiveBot
boolean
default:false

Si es true, desactiva respuestas automáticas para ese contacto tras el envío.

Response

Plantilla enviada correctamente.

messaging_product
enum<string>
Available options:
whatsapp
contacts
object[]
messages
object[]