WANotif PRO Dokumentasi API
Required variables
function sendTextMessage() {
$url = 'https://uhuy.net/api/user/v2/send_message';
$body = [
'client_id' => 'CLIENT_ID', // Client ID here
'mobile' => '919999999999',
'text' => 'Hello world',
];
$token = 'YOUR_API_KEYS'; // Your API keys here
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $token,
];
try {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
$response = curl_exec($curl);
if ($response === false) {
throw new Exception(curl_error($curl));
}
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
throw new Exception('Request failed');
}
$data = json_decode($response, true);
print_r($data); // Handle the response data as per your requirements
} catch (Exception $error) {
echo $error->getMessage();
}
}
sendTextMessage();
Required variables
function sendTextMessage() {
$url = 'https://uhuy.net/api/user/v2/send_templet'; // Replace with your domain endpoint
$body = [
'client_id' => 'CLIENT_ID', // Client ID here
'mobile' => '919999999999',
'templet_id' => 1, // Your templet ID
];
$token = 'YOUR_API_KEYS'; // Your API keys here
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $token,
];
try {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
$response = curl_exec($curl);
if ($response === false) {
throw new Exception(curl_error($curl));
}
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
throw new Exception('Request failed');
}
$data = json_decode($response, true);
print_r($data); // Handle the response data as per your requirements
} catch (Exception $error) {
echo $error->getMessage();
}
}
sendTextMessage();
{
"success": true,
"message": "The message has been successfully sent.",
"data": {}
}