WhatsApp Templates

Send WhatsApp messages

Retrieves WhatsApp templates

get/whatsapp_templates

Returns all approved WhatsApp Business templates for the account.

Only templates with status: approved can be used to send messages. Templates are required to initiate conversations outside the 24-hour window.

Respuestas

  • 200whatsapp templates found
  • 401unauthorized
Petición
curl -X GET 'https://api.vixiees.com/api/v1/whatsapp_templates' \
  -H 'X-Api-Key: YOUR_API_KEY'
Respuesta de ejemplo · 200
{
  "results": [
    {
      "_id": "string",
      "name": "string",
      "status": "string",
      "content": "string",
      "category": "string",
      "language": "string",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Sends a WhatsApp template message

post/whatsapp_templates/{id}/send_message

Sends a WhatsApp template message to a contact.

Use body_parameters to fill the template's body variables ({{1}}, {{2}}, ...). It is positional — the first element fills {{1}}, the second {{2}}, and so on — and each element must be { "type": "text", "text": "..." } (no name/value). The number of elements should match the number of variables in the template. For templates with media headers, use header_parameters with document/image/video links. For templates with URL buttons, use buttons_parameters to set the dynamic URL suffix. Use from_phone_number to choose which of the account's WhatsApp numbers sends the message.

Parámetros de ruta

  • idstringobligatorio
    The ID of the WhatsApp template to send
    Ejemplo: 64a1b2c3d4e5f678901234ab

Cuerpo de la petición · application/json

  • contact_idstringobligatorio
    Ejemplo: 64a1b2c3d4e5f678901234cd
  • from_phone_numberstring
    Ejemplo: +1234567890
  • body_parametersarray<object>
    Positional: the first element fills {{1}}, the second {{2}}, etc. Count must match the template.
  • body_parameters[].typestringobligatorio
    Ejemplo: text
  • body_parameters[].textstring
    Ejemplo: John
  • header_parametersarray<object>
  • header_parameters[].typestringobligatorio
    Ejemplo: document
  • header_parameters[].documentobject
  • header_parameters[].document.linkstring
    Ejemplo: https://example.com/document.pdf
  • buttons_parametersarray<object>
  • buttons_parameters[].typestringobligatorio
    Ejemplo: button
  • buttons_parameters[].sub_typestringobligatorio
    Ejemplo: url
  • buttons_parameters[].indexintegerobligatorio
    Ejemplo: 0
  • buttons_parameters[].parametersarray<object>
  • buttons_parameters[].parameters[].typestring
    Ejemplo: text
  • buttons_parameters[].parameters[].textstring
    Ejemplo: 12

Respuestas

  • 200message sent with buttons parameters
  • 401unauthorized
  • 404template not found
  • 422unprocessable entity
  • 503WhatsApp connection failed
Petición
curl -X POST 'https://api.vixiees.com/api/v1/whatsapp_templates/64a1b2c3d4e5f678901234ab/send_message' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "contact_id": "64a1b2c3d4e5f678901234cd",
  "from_phone_number": "+1234567890",
  "body_parameters": [
    {
      "type": "text",
      "text": "John"
    }
  ],
  "header_parameters": [
    {
      "type": "document",
      "document": {
        "link": "https://example.com/document.pdf"
      }
    }
  ],
  "buttons_parameters": [
    {
      "type": "button",
      "sub_type": "url",
      "index": 0,
      "parameters": [
        {
          "type": "text",
          "text": "12"
        }
      ]
    }
  ]
}'
Respuesta de ejemplo · 200
{}