$token = "your.token"; // https://secure.smsfactor.com/token.html;
$content = "Test API";
$numbers = [ '0601020304' , '0704030201' ];
$sender = "PHP";
$recipients = [];
foreach ($numbers as $n) $recipients[] = [ 'value' => $n ];
$postdata = [
'sms' => [
'message' => [
'text' => $content,
'sender' => $sender
],
'recipients' => array('gsm' => $recipients)
]
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.smsfactor.com/send");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postdata));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json', 'Authorization: Bearer ' . $token));
$response = curl_exec($ch);
curl_close($ch);