 <?php

if($_POST["type"]=="text"){
    $chat = [
        "secret" => "1844148152066b795d151a28068ecea663dc32d3", // your API secret from (Tools -> API Keys) page
        "account" => "1712566287a87ff679a2f3e71d9181a67b7542122c6613b00f2ac6b",
        "recipient" => $_POST["nr"], //separat prin virgula
        "type" =>  $_POST["type"], //"text", "media", "document"
        "media_url"=>$_POST["media_url"],
        "document_url"=>$_GET["document_url"],
        "message" => $_POST["msg"]
    ];
}

if($_POST["type"]=="media"){
    $chat = [
        "secret" => "1844148152066b795d151a28068ecea663dc32d3", // your API secret from (Tools -> API Keys) page
        "account" => "1712566287a87ff679a2f3e71d9181a67b7542122c6613b00f2ac6b",
        "recipient" => $_POST["nr"], //separat prin virgula
        "type" =>  $_POST["type"], //"text", "media", "document"
        "media_url"=>$_POST["media_url"],
        "message" => $_POST["msg"]
    ];
}
if($_POST["document"]=="document"){
    $chat = [
        "secret" => "1844148152066b795d151a28068ecea663dc32d3", // your API secret from (Tools -> API Keys) page
        "account" => "1712566287a87ff679a2f3e71d9181a67b7542122c6613b00f2ac6b",
        "recipient" => $_POST["nr"], //separat prin virgula
        "type" =>  $_POST["type"], //"text", "media", "document"
        "document_url"=>$_GET["document_url"],
        "message" => $_POST["msg"]
    ];
}

$cURL = curl_init("https://sms.ar-tech.ro/Install/api/send/whatsapp.bulk");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $chat);
$response = curl_exec($cURL);
curl_close($cURL);

$result = json_decode($response, true);

// do something with response
print_r($result);
?>