Our SMS API, simple and easy HTTP API
This page provides a reference for all features available through the HTTP interface forsending and the reception of SMS.The HTTP API allows you to integrate your system (client) with ROOTSMS using the HTTP protocol to send SMS messages. HTTPS is also supported for secure transactions using SSL encryption.
The client issues an HTTP GET or POST request to the ROOTSMS HTTP interface providing a list of required parameters. Our system returns an HTTP response that indicates the status of the sent message.
You can send text messages and also list SMS received on your dedicated number
Send a text message :
URL: https://api.rootsms.com/sendsms/
List received SMS messages:
URL: https://api.rootsms.com/getsms/
URL: https://api.rootsms.com/sendsms/
Settings | Description | Mandatory |
containers | Recipient number in international format | Yes |
message | The content of the SMS to send to the recipient | Yes |
apikey | The unique API key linked to your account | Yes |
URL: https://api.rootsms.com/getsms/
Settings | Description | Mandatory |
apikey | The unique API key linked to your account | Yes |
No longer used
/SENDSMS
Possible responses when sending an SMS:
/RESENDSMS
Possible responses when re-sending an SMS):
Test your KEY API here
Display the list of reachable countries
Request a free KEY API
Possible responses when sending an SMS:
Coded | Description |
0 | The message is sent without error |
6 | Process time exceeded |
7 | The message is not sent |
30 | Internal error - Contact technical support |
40 | KEY API is disabled |
60 | API KEY is missing |
50 | API is not correct |
70 | Number of multiple sendings via the same request: 4 numbers |
80 | Your account does not allow multiple sending |
99 | The destination country is not reachable at the moment |
100 | Exceeding the limit of sending one SMS per minute (depends on your api key and option |
/RESENDSMS
Possible responses when re-sending an SMS):
Coded | Description |
200 | missing message id |
201 | message id does not exist |
202 | the message has already been sent |
Test your KEY API here
Display the list of reachable countries
Request a free KEY API
SEND A TEXT MESSAGE : /SENDSMS
//3 mandatory parameters
$phonenumber = "0032494000000";
$message = "Hello World";
$apikey = "3bae4f51b8b8fd266987c........";
$URL = "https://api.rootsms.com/sendsms/?recipients=$phonenumber&message=$message&apikey=$apikey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
RESEND A PENDING SMS: /RESENDSMS
//2 mandatory parameters
$apikey = "3bae4f51b8b8fd266987c........";
$id = "123456789465465.....";
$URL = "http://api.rootsms.com/resendsms/?apikey=$apikey&id=$id";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
LIST RECEIVED SMS: /GETSMS
//2 mandatory parameters
$apikey = "3bae4f51b8b8fd266987c........";
$URL = "http://api.rootsms.com/getsms/?apikey=$apikey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
//3 mandatory parameters
$phonenumber = "0032494000000";
$message = "Hello World";
$apikey = "3bae4f51b8b8fd266987c........";
$URL = "https://api.rootsms.com/sendsms/?recipients=$phonenumber&message=$message&apikey=$apikey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
RESEND A PENDING SMS: /RESENDSMS
//2 mandatory parameters
$apikey = "3bae4f51b8b8fd266987c........";
$id = "123456789465465.....";
$URL = "http://api.rootsms.com/resendsms/?apikey=$apikey&id=$id";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
LIST RECEIVED SMS: /GETSMS
//2 mandatory parameters
$apikey = "3bae4f51b8b8fd266987c........";
$URL = "http://api.rootsms.com/getsms/?apikey=$apikey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1TP5Allput = curl_exec($ch);
echo 1TP5Allput;
curl_close($ch);
SEND A TEXT MESSAGE :
Use the unique email address linked to your API KEY (see in your management interface).
For example :
Use the unique email address linked to your API KEY (see in your management interface).
For example :
- Send an email to the address 1234567910@mailtosms.co (your unique email address)
- With as object : the recipient's phone number
- With like body message: the content of the sms to send
SEND A TEXT MESSAGE :
/SENDSMS
WebService URL: https://api.rootsms.com/sendsms/wsdl/sendSmsNow.wsdl
require_once "lib/nusoap.php";
$client = new nusoap_client("sendSmsNow.wsdl", true);
$error = $client->getError();
$result = $client->call("sendSms", array("recipients" =>$_GET['recipients'],"message" =>$_GET['message'],"apikey" =>$_GET['apikey'])) ;
$finalOut = '
<error>'.$result['return']['error'].'< /error >
<feels>'.$result['return']['sent'].'< /sent >
<id>'.$result['return']['id'].' ';< /id >
echo $finalOut;
WebService URL: https://api.rootsms.com/sendsms/wsdl/sendSmsNow.wsdl
require_once "lib/nusoap.php";
$client = new nusoap_client("sendSmsNow.wsdl", true);
$error = $client->getError();
$result = $client->call("sendSms", array("recipients" =>$_GET['recipients'],"message" =>$_GET['message'],"apikey" =>$_GET['apikey'])) ;
$finalOut = '
<error>'.$result['return']['error'].'< /error >
<feels>'.$result['return']['sent'].'< /sent >
<id>'.$result['return']['id'].' ';< /id >
echo $finalOut;
SEND A TEXT MESSAGE :
/SENDSMS
ResLaunch = HTTPRequest("https://api.rootsms.com/sendsms/")
IF ResLaunch = True THEN
ResCode = HTTPGiveResult()
Info("HTML code: " + ResCode)
END
ResLaunch = HTTPRequest("https://api.rootsms.com/sendsms/")
IF ResLaunch = True THEN
ResCode = HTTPGiveResult()
Info("HTML code: " + ResCode)
END
It is possible to test the integration and correct configuration of your API via this link: https://api.rootsms.com/sendsms/test/
Did you know ? you can quickly delete sent SMS history.