Last active
January 5, 2024 22:22
-
-
Save jhowbhz/e393577603c05b54029009d2046ca182 to your computer and use it in GitHub Desktop.
Exemplo sendText PHP com Myzap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****************************************************************************************************************/ | |
/* Antes de utilizar esses codigos, inicie a sessão em https://whatsapp-v2.apibrasil.com.br/start */ | |
/****************************************************************************************************************/ | |
try { | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'https://apiwhatsapp-7150.apibrasil.com.br//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 =>'{ | |
"session" : "teste", | |
"number" : "5531994359434", | |
"time_typing": 1, | |
"text": "teste" | |
}', | |
CURLOPT_HTTPHEADER => array( | |
'Content-Type: application/json', | |
'sessionkey: teste' | |
), | |
)); | |
$response = curl_exec($curl); | |
curl_close($curl); | |
echo $response; | |
curl_close($curl); | |
var_dump($callback); // callback | |
} catch (\Throwable $th) { | |
throw $th; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment