curl https://api.heybot.cloud/v1/messages \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{ payload }'
curl https://api.heybot.cloud/v1/messages \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "text",
"payload": {
"body": "demo",
"linkPreview": false
}
}'
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "text",
"payload": {
"body": "demo",
"linkPreview": false
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "image",
"payload": {
"url": "https://s3-amazon.com/mi-imagen.png",
"body": "Este mensaje es opcional"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "document",
"payload": {
"url": "https://example.com/document.pdf",
"filename": "document.pdf"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "audio",
"payload": {
"url": "https://example.com/audio.mp3"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "sticker",
"payload": {
"url": "https://example.com/sticker.webp"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "interactiveList",
"payload": {
"header": "Encabezado opcional",
"body": "Este es el cuerpo del mensaje con longitud fija de 4096 caracteres...",
"footer": "Este es un pie de mensaje opcional",
"button": "Ver opciones",
"sections": [
{
"title": "Sección 1",
"rows": [
{
"id": "opcion_1",
"title": "Opción 1",
"description": "Descripción de la opción 1"
},
{
"id": "opcion_2",
"title": "Opción 2",
"description": "Descripción de la opción 2"
}
]
}
]
}
}
Interactive list messages allow you to present WhatsApp users with a list of options to choose from (options are defined as rows in the request payload)
When a user taps the button in the message, it displays a modal that lists the options available:
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "location",
"payload": {
"latitude": "19.432608",
"longitude": "-99.133209",
"locationName": "CDMX Centro",
"address": "Av. Reforma, CDMX, México"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "requestLocation",
"payload": {
"body": "Por favor, comparte tu ubicación actual"
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "callToAction",
"payload": {
"header": "Consulta disponible",
"body": "Para más detalles sobre tu solicitud, consulta el siguiente enlace.",
"footer": "Atención personalizada",
"button": {
"text": "Abrir enlace",
"url": "https://heybot.cloud"
}
}
}