API Oficial (NATIVA) - Interactives
2 min
Envio de Template
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendInteractive',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"number": "5511989091838",
"type": "button",
"header": {
"type": "document",
"document": {
"link": "https://file-examples.com/wp-content/storage/2017/10/file-example_PDF_1MB.pdf",
"filename": "catalogo-produtos-2024.pdf"
}
},
"body": {
"text": "Confira nosso catálogo completo com todos os produtos disponíveis e escolha o que mais combina com você!"
},
"buttons": [
{
"type": "reply",
"reply": {
"id": "fazer_pedido",
"title": "Fazer Pedido"
}
},
{
"type": "reply",
"reply": {
"id": "falar_vendedor",
"title": "Falar com Vendedor"
}
}
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer seutoken'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;