আপনার মোবাইলের WhatsApp অ্যাপ খুলে Linked Devices > Link a Device এ গিয়ে নিচের কোডটি স্ক্যান করুন:
নিচের পিএইচপি কোডটি কপি করে আপনার ওয়েবসাইটে ব্যবহার করুন। যেকোনো ওয়েবসাইট থেকে সরাসরি হোয়াটসঅ্যাপ চ্যানেলে পোস্ট চলে যাবে:
<?php
/**
* WhatsApp Channel Auto Post via Evolution API
* Server IP: 153.75.245.214
*/
function sendWhatsAppChannelPost($channelJid, $message, $imageUrl = null) {
$apiUrl = "https://wp.tahmid.pw";
$apiKey = "WA_AUTO_POST_SECRET_2026_KEY";
$instance = "channel_bot";
if (!empty($imageUrl)) {
// Send Image with Caption
$endpoint = "{$apiUrl}/message/sendMedia/{$instance}";
$payload = [
"number" => $channelJid,
"mediatype" => "image",
"media" => $imageUrl,
"caption" => $message
];
} else {
// Send Text Only
$endpoint = "{$apiUrl}/message/sendText/{$instance}";
$payload = [
"number" => $channelJid,
"text" => $message
];
}
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"apikey: {$apiKey}"
]);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
return $error ? json_encode(["error" => $error]) : $response;
}
// ব্যবহার করার উদাহরণ:
$myChannel = "120363206822480233@newsletter"; // আপনার চ্যানেলের JID
$postText = "নতুন ক্যাম্পেইন অফার!
আজই অর্ডার করুন।";
$result = sendWhatsAppChannelPost($myChannel, $postText);
echo $result;
?>