<?php
namespace App\Helpers\ProviderWa;
class ProviderWoowa {
public static function SendMessage($number, $message, $key, $version = 3)
{
$url = 'http://116.203.92.59/api/async_send_message';
if($version == 4){
$url = 'https://notifapi.com/async_send_message';
}
$data = array(
"phone_no" => $number,
"key" => $key,
"message" => $message,
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
public static function SendMessageFile($number, $file_path, $key, $version = 3)
{
$url = 'http://116.203.191.58/api/async_send_file_url';
if($version == 4){
$url = 'https://notifapi.com/async_send_file_url';
}
$data = array(
"phone_no" => $number,
"key" => $key,
"url" => $file_path
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
public static function ScheduleMessage($number, $message, $datetimes, $key, $version = 3)
{
$url = 'http://116.203.191.58/api/scheduler';
if($version == 4){
$url = 'https://notifapi.com/scheduler';
}
$data = array(
"phone_no" => $number,
"key" => $key,
"sch_date" => $datetimes,
"api_type" => 'text',
"message" => $message,
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
public static function ScheduleMessageFile($number, $file_path, $datetimes, $key, $version = 3)
{
$url = 'http://116.203.191.58/api/scheduler';
if($version == 4){
$url = 'https://notifapi.com/scheduler';
}
$data = array(
"phone_no" => $number,
"key" => $key,
"sch_date" => $datetimes,
"api_type" => 'file', // (text, image_text, image, file)
// "url" => $img_url
"url" => $file_path
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
public static function RemoveScheduleMessage($id_pesan, $key, $version = 3)
{
$message_id = $id_pesan;
$url = 'http://116.203.191.58/api/sch_remove';
if($version == 4){
$url = 'https://notifapi.com/sch_remove';
}
$data = array(
"msg_id" => $message_id,
"key" => $key
);
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 360);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string)
)
);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]