Saltar al contenido

API Cloud (MESSAGES)

La API Cloud es la forma más sencilla y rentable de usar WhatsApp para negocios, sin necesidad de actualizaciones. Todas las funciones disponibles se describen a continuación.

Autenticación

Servicio para obtener el token de autenticación usado en cada iteración. La vigencia es de 8 horas y es válido solo para el usuario logueado.

Request

POST /login

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/login' \
  --header 'Content-Type: application/json' \
  --data '{
    "username": "<user>",
    "password": "<password>"
  }'

Response

Success (200)

{
  "user": "<user>",
  "access": true,
  "access_token": "<token valido>"
}

Envío de mensajería

Debes crear una plantilla de mensaje antes de poder enviar una. Puedes consultar a nuestro equipo para un asesoramiento en ese caso.

Se pueden enviar diversos tipos de mensajes:

  • Mensajes de plantilla
  • Mensajes de texto
  • Mensajes de contenido multimedia
  • Mensajes de reacción
  • Mensajes de ubicación
  • Mensajes de contacto
  • Mensajes interactivos

Para enviarlos, realiza una llamada POST /{version}/{did}/messages y adjunta un objeto de mensaje con el tipo que desees.

Para más información, consulta la documentación de envío de mensajes de Meta.

Toda petición debe incluir el header de autenticación:

["Authorization" : "<JWT>"]

Plantillas

Request

POST /{version}/{did}/messages

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "messaging_product": "whatsapp",
    "to": "{{Recipient-WA-ID}}",
    "type": "template",
    "template": {
      "name": "hello_world",
      "language": {
        "code": "en_US"
      }
    }
  }'

Response

Success (200)
{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "48XXXXXXXXX",
      "wa_id": "48XXXXXXXXX"
    }
  ],
  "messages": [
    {
      "id": "wamid.gBGGSFcCNEOPAgkO_KJ55r4w_ww"
    }
  ]
}

Envío con BSUID (identificadores 2026)

Además del número telefónico (to), los endpoints de mensajería aceptan un destinatario BSUID o Parent BSUID mediante el campo recipient. El payload se reenvía a Meta tal cual (passthrough), sin mutar ni reordenar campos; si se envían to y recipient, to tiene prioridad.

Consulta Business-scoped user IDs (BSUID) para los ejemplos de envío por BSUID, los campos nuevos en webhooks 2026 y el error 131062.

Texto

Request

POST /{version}/{did}/messages

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{Recipient-Phone-Number}}",
    "type": "text",
    "text": {
      "preview_url": false,
      "body": "text-message-content"
    }
  }'

Response

Success (200)

Respuesta con wamid (ver Respuesta exitosa).

Multimedia

En API Cloud, la mensajería multimedia incluye todos los tipos de mensajes, incluidos stickers y documentos. Se pueden enviar los tipos audio, document, image, sticker o video; solo debes cambiar el type y la key del payload.

Request — Imagen

POST /{version}/{did}/messages

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{Recipient-Phone-Number}}",
    "type": "image",
    "image": {
      "link": "http(s)://image-url"
    }
  }'

Request — Documento

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{Recipient-Phone-Number}}",
    "type": "document",
    "document": {
      "link": "http(s)://document-url"
    }
  }'

Request — Sticker

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{Recipient-Phone-Number}}",
    "type": "sticker",
    "sticker": {
      "link": "http(s)://sticker-url"
    }
  }'

Response

Success (200)

Respuesta con wamid (ver Respuesta exitosa).

Flows

A partir de la versión 17 y 18 de API Cloud es posible enviar flows por medio de un mensaje interactivo o plantilla.

Request — Flow como mensaje interactivo

POST /{version}/{did}/messages

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "recipient_type": "individual",
    "messaging_product": "whatsapp",
    "to": "whatsapp-id",
    "type": "interactive",
    "interactive": {
      "type": "flow",
      "header": { "type": "text", "text": "Flow message header" },
      "body": { "text": "Flow message body" },
      "footer": { "text": "Flow message footer" },
      "action": {
        "name": "flow",
        "parameters": {
          "flow_message_version": "3",
          "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
          "flow_id": "1",
          "flow_cta": "Book!",
          "flow_action": "navigate",
          "flow_action_payload": {
            "screen": "<SCREEN_NAME>",
            "data": {
              "product_name": "name",
              "product_description": "description",
              "product_price": 100
            }
          }
        }
      }
    }
  }'

Request — Flow como plantilla

curl --request POST \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/v19.0/{did}/messages' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "recipient_type": "individual",
    "messaging_product": "whatsapp",
    "to": "whatsapp-id",
    "type": "interactive",
    "interactive": {
      "type": "flow",
      "header": { "type": "text", "text": "Flow message header" },
      "body": { "text": "Flow message body" },
      "footer": { "text": "Flow message footer" },
      "action": {
        "name": "flow",
        "parameters": {
          "flow_message_version": "3",
          "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
          "flow_id": "1",
          "flow_cta": "Book!",
          "flow_action": "navigate",
          "flow_action_payload": {
            "screen": "<SCREEN_NAME>",
            "data": {
              "product_name": "name",
              "product_description": "description",
              "product_price": 100
            }
          }
        }
      }
    }
  }'

Response

Success (200)

Respuesta con wamid (ver Respuesta exitosa).

Respuesta exitosa

Para todos los casos, la respuesta exitosa devuelve un objeto con un identificador con prefijo wamid:

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "48XXXXXXXXX",
      "wa_id": "48XXXXXXXXX"
    }
  ],
  "messages": [
    {
      "id": "wamid.gBGGSFcCNEOPAgkO_KJ55r4w_ww"
    }
  ]
}

Adjuntos

La ruta GET /v15.0/{id}/{did}/media devuelve un archivo multimedia. Debe incluir el header de autenticación:

["Authorization" : "<JWT>"]

Webhook de cliente

La ruta PATCH /webhooks/inbound agrega o cambia el endpoint que permite la recepción de los mensajes inbound del cliente.

Request

PATCH /webhooks/inbound

curl --request PATCH \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/webhooks/inbound' \
  --header 'Authorization: <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{
    "waId": "<identificador del canal>",
    "externalWebhook": "<URL segura HTTPS>"
  }'
CampoTipoObligatorioDescripción
waIdStringIdentificador del canal.
externalWebhookStringURL del cliente para el despacho de mensajes inbound.

Response

Success (200)

{
  "waId": "<identificador del canal>",
  "externalWebhook": "<URL segura HTTPS>"
}
Para el formato del payload inbound, consulta los ejemplos de payload de Meta.

Errores

Errores generales

Los endpoints que requieren autorización por token presentan los siguientes errores:

CódigoMensaje
401JWT was invalid (token incorrecto)
401unauthorized Access (token con permisos insuficientes)
401token up for parsing was not passed through the header... (token vacío)

Errores específicos

POST /login

CódigoMensaje
400invalid Password (contraseña incorrecta)
400unsupported get request. username '<user>' does not exist... (usuario incorrecto)

POST /{did}/messages

CódigoMensaje
400(#131030) Recipient phone number not in allowed list (payload incorrecto)
400unsupported get request. Object with ID '<bad-did>' does not exist... (did incorrecto)

GET /{id}/{did}/media

CódigoMensaje
400unsupported get request. Object with ID 'did-bad' does not exist (did incorrecto)
400Unsupported get request. Object with ID '<id>' does not exist... (id incorrecto)

PATCH /webhooks/inbound

CódigoMensaje
400unsupported get request. Object with ID 'XXXXXXX' does not exist (waId incorrecto)
Para más información, consulta el apartado de errores de Meta.