Skip to content

Instantly share code, notes, and snippets.

@jhowbhz
Last active April 7, 2025 15:06
Show Gist options
  • Save jhowbhz/a577712a425b5e45061d5e3fd0eab511 to your computer and use it in GitHub Desktop.
Save jhowbhz/a577712a425b5e45061d5e3fd0eab511 to your computer and use it in GitHub Desktop.
Novo sendText evolution 2.2.3
<?php
//Nova versão do servidor 2.2.3
$body = json_encode([
"number" => "5531994359434",
"options" => [
"delay" => 1,
"presence" => "composing"
],
"text" => 'Mensagem enviada...'
]);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gateway.apibrasil.io/api/v2/evolution/message/sendText',
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 => $body,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'DeviceToken: Seu_Device_Token_Aqui',
'Authorization: Bearer token......'
),
));
$response = curl_exec($curl);
curl_close($curl);
//DESCOMENTE PARA DEBUGAR
//var_dump($response);die;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment