// Create SMS Body for request
$sms_body = array(
'action' => 'send-sms',
'api_key' => $api_key, // Votre API key
'to' => $destination, // Numer avec prefix du pays exemple: 21655899090
'from' => $from, // Sender ID le nom d’expéditeur lié a votre compte
'sms' => $sms // Contenu du sms
);
//$url : L'url de votre api peut être récupérer de votre compte
$send_data = http_build_query($sms_body);
$gateway_url = $url . "?" . $send_data;
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $gateway_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
$output = curl_exec($ch);
if (curl_errno($ch)) {
$output = curl_error($ch);
}
curl_close($ch);
var_dump($output);
}catch (Exception $exception){
echo $exception->getMessage();
}