logo

Ejemplos

Last update: 3 days ago by Jimena Acevedo - JC

Mensaje de texto

Petición HTTP

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"from": "{{phone-number-id}}",
"to": "{{to}}",
"type": "text",
"text": "Tu pedido ya esta en camino.",
"category": "utility"
}'


Atribución de template

Petición HTTP

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"from": "{{numero_emisor}}",
"to": "{{numero_destino}}",
"type": "text",
"text": "Tu pedido TC01-9988 esta en camino.",
"category": "utility",
"direct_send_config": { "template_name": "orden_en_camino_v1" }
}'


Botones combinados (CTA URL + respuesta)

Body

{
"from": "{{phone-number-id}}",
"to": "{{to}}",
"type": "interactive",
"category": "utility",
"direct_send_config": {
"template_name": "{{template_name}}_btns"
},
"replyButtons": {
"body": "Elige una opcion",
"buttons": [
{ "type": "cta_url", "title": "Visitar sitio", "url": "https://www.conceptomovil.com" },
{ "type": "reply", "id": "btn_1", "title": "Opcion 1" },
{ "type": "reply", "id": "btn_2", "title": "Opcion 2" }
]
}
}


Botón de llamada de voz

Body

{
"from": "{{phone-number-id}}",
"to": "{{to}}",
"type": "interactive",
"category": "utility",
"direct_send_config": {
"template_name": "{{template_name}}"
},
"voice_call": {
"body": "Te llamaremos para confirmar tu pedido",
"action": {
"parameters": {
"display_text": "Llamar ahora",
"ttl_minutes": 60
}
}
}
}
Whatsapp — Anterior
Objetos
Siguiente — Whatsapp
Respuesta