POST/api/send-group
<?php
$curl = curl_init();
$token = "";
$data = [
'groupId' => '154xxxxx',
'phone' => '081XXXXXXX',
'message' => 'hellow world',
];
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
"Authorization: $token",
)
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_URL, "http://app.absen.co.id/api/send-group");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);
echo "<pre>";
print_r($result);
?>
Request parameters:
Authorization | Required | Your Token from http://app.absen.co.id, can be seen in the menu: Device – Setting |
---|---|---|
groupId | Required | The ID number of WhatsApp group. You can check on message menu to looking ID Whatsapp group. Example: 15423xxxx |
phone | Required | Whatsapp numbers who is creator of group and don’t forget sender number must be admin of group. You can use the country code prefix or not. Example: 081223xxxx |
message | Required | Text message to be sent. Format: UTF-8 or UTF-16 string. for single newline (\n), double newline (\n2) |