Saltar al contenido principal
POST
/
v1
/
bots
/
{botId}
/
messages
curl --request POST \
  --url https://api.jelou.ai/v1/bots/BOT_ID/messages \
  --header 'Authorization: Basic <Base64Encoded clientId:clientSecret>' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "text",
    "text": "Por favor selecciona una opción",
    "userId": "USER_ID",
    "buttons": {
      "title": "Elige una opción",
      "buttonText": {
        "type": "text",
        "text": "Ver Opciones"
      },
      "options": [
        {
          "title": "Opción 1",
          "description": "Esta es la primera opción",
          "payload": "OPCION_1"
        },
        {
          "title": "Opción 2",
          "description": "Esta es la segunda opción",
          "payload": "OPCION_2"
        },
        {
          "title": "Opción 3",
          "description": "Esta es la tercera opción",
          "payload": "OPCION_3"
        }
      ]
    }
  }'
{
  "success": true,
  "messageId": "msg_123456789"
}
curl --request POST \
  --url https://api.jelou.ai/v1/bots/BOT_ID/messages \
  --header 'Authorization: Basic <Base64Encoded clientId:clientSecret>' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "text",
    "text": "Por favor selecciona una opción",
    "userId": "USER_ID",
    "buttons": {
      "title": "Elige una opción",
      "buttonText": {
        "type": "text",
        "text": "Ver Opciones"
      },
      "options": [
        {
          "title": "Opción 1",
          "description": "Esta es la primera opción",
          "payload": "OPCION_1"
        },
        {
          "title": "Opción 2",
          "description": "Esta es la segunda opción",
          "payload": "OPCION_2"
        },
        {
          "title": "Opción 3",
          "description": "Esta es la tercera opción",
          "payload": "OPCION_3"
        }
      ]
    }
  }'

Restricciones

  • Opciones: Mínimo 1, máximo 10 opciones por mensaje
  • Título de Opción: Máximo 24 caracteres
  • Descripción de Opción: Máximo 72 caracteres
  • Texto del Botón: Por defecto es “Opciones” si no se especifica

Casos de Uso

  • Crear menús de navegación
  • Proporcionar opciones de selección múltiple
  • Guiar a los usuarios a través de un flujo
  • Recopilar respuestas estructuradas

Autorizaciones

Authorization
string
header
requerido

Basic authentication using Base64 encoded clientId:clientSecret

Parámetros de ruta

botId
string
requerido

The unique identifier of the bot

Cuerpo

application/json

Message payload. The structure varies based on the message type.

type
enum<string>
requerido

Type of message to send

Opciones disponibles:
text
Ejemplo:

"text"

userId
string
requerido

Unique identifier of the user receiving the message

Ejemplo:

"USER_ID"

text
string
requerido

Text content of the message

Ejemplo:

"Hello, this is a text message"

botId
string

Unique identifier of the bot sending the message

Ejemplo:

"BOT_ID"

Respuesta

Message sent successfully

success
boolean
Ejemplo:

true

messageId
string
Ejemplo:

"msg_123456789"