<?php
// API Key and Device ID
$api_key = '6f55231f-5112-486e-9f81-11f6ed30accf';
$device_id = '66f5782d65c9fd8b407af018';

// SMS Details
$recipients = ['+254794131895'];  // Replace with the recipient's phone number
$message = 'Hello World!';

// Prepare the payload
$data = [
    'recipients' => $recipients,
    'message' => $message
];

// Initialize cURL
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, "https://a...content-available-to-author-only...e.dev/api/v1/gateway/devices/$device_id/sendSMS");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Set headers
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'x-api-key: ' . $api_key,
    'Content-Type: application/json'
]);

// Execute cURL request and capture the response
$response = curl_exec($ch);

// Check for errors
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    // Print the response from the API
    echo 'Response: ' . $response;
}

// Close cURL session
curl_close($ch);
?>
