$url = "https://gatewayapi.com/rest/mtsms"; $api_token = "THIS_API-TOKEN"; //Set SMS recipients and content $recipients = [4512345678, 4587654321]; json = [ 'sender' => 'ExampleSMS', 'message' => 'Hello world', 'recipients' => [], ]; foreach ($recipients as $msisdn) { $json['recipients'][] = ['msisdn' => $msisdn]; } //Make and execute the http request //Using the built-in 'curl' library $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_HTTPHEADER, array("Content-Type: application/json"))); curl_setopt($ch,CURLOPT_USERPWD, $api_token.":"); curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($json)); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); print($result); $json = json_decode($result); print_r($json->ids);

futurecareerschool

Future Career School

Refining Skills for Career

Unlocking Success: Refining Skills for a Rewarding Career Journey After 12th As high school graduates stand on the threshold of their academic journey, the transition from school to the professional world can be both thrilling and challenging. One key factor that can...

Confused for your Career?

Connect & Consult with our Best Career Counsellors