Send SMS (v1)
The HTTP API enables you to send SMS quickly. To send an SMS, simply call the following URL with the relevant parameters appended to the URL, as shown below:
Endpoint
Request Parameters
Parameters
Type
Description
Sample Requests
<?php
//defining the parameters
$apiKey = '63f113a2d1d06b27ebd33a4ui63e71902al3'; //Remember to put your account API Key here
$recipient = 23324xxxxxxx; //International format (233) excluding the (+)
$sender = 'TextCus'; //11 Characters maximum
$msg = "Hello, TextCus SMS is the best!";
//encode the message
$message = urlencode($msg);
$url = 'https://sms.textcus.com/api/send?apikey=' . $apiKey . '&destination=' . $recipient . '&source=' . $sender . '&dlr=0&type=0' . '&message=' . $message . '';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>Sample Response
Last updated