67 lines
1.8 KiB
PHP
Executable File
67 lines
1.8 KiB
PHP
Executable File
<?php
|
|
|
|
// $ch = curl_init();
|
|
|
|
// curl_setopt($ch, CURLOPT_URL, 'https://wa-toolbox.web.app/webhooks/62OPY5MLO');
|
|
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
// curl_setopt($ch, CURLOPT_POST, 1);
|
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"action\": \"send-message\",\n \"type\": \"text\",\n \"content\": \"Hello, WhatsApp!\",\n \"phone\": \"966530710125\"\n}");
|
|
|
|
// $headers = array();
|
|
// $headers[] = 'Content-Type: application/x-www-form-urlencoded';
|
|
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
// $result = curl_exec($ch);
|
|
// if (curl_errno($ch)) {
|
|
// echo 'Error:' . curl_error($ch);
|
|
// }
|
|
// curl_close($ch);
|
|
|
|
|
|
|
|
|
|
// $ch = curl_init();
|
|
|
|
// curl_setopt($ch, CURLOPT_URL, 'https://wa-toolbox.web.app/webhooks/62OPY5MLO');
|
|
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
// curl_setopt($ch, CURLOPT_POST, 1);
|
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"action\": \"send-template\",\n \"template\": \"welcome\",\n \"phone\": \"966530710125\"\n}");
|
|
|
|
// $headers = array();
|
|
// $headers[] = 'Content-Type: application/x-www-form-urlencoded';
|
|
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
// $result = curl_exec($ch);
|
|
// if (curl_errno($ch)) {
|
|
// echo 'Error:' . curl_error($ch);
|
|
// }
|
|
// curl_close($ch);
|
|
|
|
|
|
|
|
// for whats app web
|
|
|
|
$curl = curl_init();
|
|
|
|
curl_setopt_array($curl, array(
|
|
CURLOPT_URL => 'https://wa-toolbox.web.app/webhooks/XYZ',
|
|
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 =>'{
|
|
"action": "send-message",
|
|
"type": "text",
|
|
"content": "Hello, WhatsApp!",
|
|
"phone": "966530710125"
|
|
}',
|
|
));
|
|
|
|
$response = curl_exec($curl);
|
|
|
|
curl_close($curl);
|
|
echo $response;
|