The following example shows how you can send a message using our REST API and PHP
Send SMS Message
<html> <head> <title>Send SMS Example</title> </head> <body> <?php // Define vars $url = 'http://api.123-txt.com/rest/SendSms'; $fields = array( 'user' => 'your email address here', 'pass' => 'your password here', 'source' => '44 prefixed source number assigned to your account', 'destination' => 'international format destination number (44xxxxxxxxxx)', 'sms' => urlencode('Your SMS goes here, embedded URLs are affected by the Tiny URL setting in your user interface settings under settings->general') ); $fields_data = json_encode($fields); // Open $ch = curl_init(); // Set the URL, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($fields_data)) ); // Issue post $result = curl_exec($ch); // Close curl_close($ch); echo " SendSms Result: [$result] "; ?> </body> </html>