Saat klien mengirimkan kirimannya, anda bisa mendapatkan datanya dan menyimpannya ke sistem anda sendiri atau melakukan apa pun dengannya.
Salin dan gunakan sesuka anda di sistem anda.
<?php
header('Content-Type: application/json; charset=utf-8');
$json = file_get_contents('php://input');
$data = json_decode($json, true);
$sender = $data["sender"];
$submission = $data["submission"];
$name = $data["name"];
$list = $data["data"];
function sendFonnte($target, $data)
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.fonnte.com/send",
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 => array(
'target' => $target,
'message' => $data["message"],
),
CURLOPT_HTTPHEADER => array(
"Authorization: TOKEN"
),
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
$reply = [
"message" => $json
];
sendFonnte("082227097005", $reply); //change number to your own number
Available parameter
- Penyerahan- Nama penyerahan
- Pengirim - Nomor whatsapp pengirim
- Nama - Nama pengirim
- Daftar - Data penyerahan