Mensagem para Grupos

<?php
 
$curl = curl_init();
 
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BACKEND_URL}/api/messages/sendGroup',
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": "34324434543543212", //ID DO GRUPO
"openTicket": "0", //0 N&atilde;o abre ticket e 1 Abre Ticket
"queueId": "0", // Informe o ID da fila desejada (Se abrir ticket)
"body": "Teste"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer seutokenaqui' //Token cadastrado na conex&atilde;o
),
));
 
$response = curl_exec($curl);
 
curl_close($curl);
echo $response;

Was this article helpful?