logo

Ejemplos

Last update: 17 minutes ago by Irais Aguirre

Ajustes de llamada

Petición HTTP configurar ajustes de llamada

curl -X POST 'https://{url}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/phone-number/{waba}/{phone_number}/call-settings' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"status": "ENABLED",
"call_icon_visibility": "DEFAULT",
"call_hours": {
"status": "ENABLED",
"timezone_id": "America/Manaus",
"weekly_operating_hours": [
{
"day_of_week": "MONDAY",
"open_time": "0400",
"close_time": "1020"
},
{
"day_of_week": "TUESDAY",
"open_time": "0108",
"close_time": "1020"
}
],
"holiday_schedule": [
{
"date": "2026-01-01",
"start_time": "0000",
"end_time": "2359"
}
]
},
"callback_permission_status": "ENABLED"
}'
Ejemplo body ajustes de llamada
{
"status": "ENABLED",
"call_icon_visibility": "DEFAULT",
"call_hours": {
"status": "ENABLED",
"timezone_id": "America/Manaus",
"weekly_operating_hours": [
{
"day_of_week": "MONDAY",
"open_time": "0400",
"close_time": "1020"
},
{
"day_of_week": "TUESDAY",
"open_time": "0108",
"close_time": "1020"
}
],
"holiday_schedule": [
{
"date": "2026-01-01",
"start_time": "0000",
"end_time": "2359"
}
]
},
"callback_permission_status": "ENABLED"
}

Operaciones de negocio durante llamada

Iniciar llamada

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint/services/v1/call' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"action":"connect",
"sdp" : "<<RFC 8866 SDP>>",
"biz_opaque_callback_data": "0fS5cePMok"
}'
Ejemplo body iniciar llamada
{
"from": "5215500000001",
"to": "5215500000002",
"action":"connect",
"sdp" : "<<RFC 8866 SDP>>",
"biz_opaque_callback_data": "0fS5cePMok"
}

Pre aceptar llamada

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint/services/v1/call' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"action":"pre_accept",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"sdp" : "<<RFC 8866 SDP>>"
}'
Ejemplo body pre aceptar llamada
{
"from": "5215500000001",
"to": "5215500000002",
"action":"pre_accept",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"sdp" : "<<RFC 8866 SDP>>"
}

Aceptar llamada

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint/services/v1/call' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"action":"accept",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"sdp" : "<<RFC 8866 SDP>>"
}'
Ejemplo aceptar llamada
{
"from": "5215500000001",
"to": "5215500000002",
"action":"accept",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"sdp" : "<<RFC 8866 SDP>>"
}

Rechazar llamada

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint/services/v1/call' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"action":"reject",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh"
}'
Ejemplo body rechazar llamada
{
"from": "5215500000001",
"to": "5215500000002",
"action":"reject",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh"
}

Terminar llamada

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint/services/v1/call' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"action":"terminate",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
}'
Ejemplo body terminar llamada
{
"from": "5215500000001",
"to": "5215500000002",
"action":"terminate",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
}
Whatsapp — Anterior
Operaciones de negocio durante la llamada
Siguiente — Whatsapp
Flows