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"
}
}
WhatsApp users may be hesitant to tap raw URLs containing lengthy or obscure strings in text messages. In these situations, you may wish to send an interactive call-to-action (CTA) URL button message instead. CTA URL button messages allow you to map any URL to a button so you don't have to include the raw URL in the message body.
{
"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"
}
}
}
{
"toPhoneNumber": "521XXXXXXXXXX",
"type": "callToAction",
"payload": {
"file": {
"type": "document|image|video",
"url": "https://heybot.cloud/assets/docs/cta.png"
},
"body": "Para mas detalles sobre tu solicitud, consulta el siguiente enlace.",
"footer": "Atencion personalizada",
"button": {
"text": "Abrir enlace",
"url": "https://heybot.cloud"
}
}
}
{ "toPhoneNumber": "521XXXXXXXXXX", "type": "contact", "payload": [ { "name": { "formatted_name": "<CONTACT_FORMATTED_NAME> <Required>", "first_name": "<CONTACT_FIRST_NAME> <Required>", "last_name": "<CONTACT_LAST_NAME> <Optional*>", "middle_name": "<CONTACT_MIDDLE_NAME> <Optional*>", "suffix": "<CONTACT_SUFFIX> <Optional*>", "prefix": "<CONTACT_PREFIX> <Optional*>" }, "org": { "company": "<CONTACT_ORG_COMPANY> <Optional>", "department": "<CONTACT_ORG_DEPARTMENT> <Optional>", "title": "<CONTACT_ORG_TITLE> <Optional>" }, "phones": [ { "phone": "<CONTACT_PHONE> <Optional>", "wa_id": "<CONTACT_WA_ID> <Optional>", "type": "<CELL|MAIN|IPHONE|HOME|WORK> <Optional>" } ], "addresses": [ { "street": "<ADDRESS_STREET> <Optional>", "city": "<ADDRESS_CITY> <Optional>", "state": "<ADDRESS_STATE> <Optional>", "zip": "<ADDRESS_ZIP> <Optional>", "country": "<ADDRESS_COUNTRY> <Optional>", "country_code": "<ADDRESS_COUNTRY_CODE> <Optional>", "type": "<HOME|WORK> <Optional>" } ], "birthday": "<YYYY-MM-DD> <Optional>", "emails": [ { "email": "<CONTACT_EMAIL> <Optional>", "type": "<WORK|HOME> <Optional>" } ], "urls": [ { "url": "<CONTACT_URL> <Optional>", "type": "<HOME|WORK> <Optional>" } ] } ] }