SMS API

It is very easy to start messaging with our smart API. There are no messy libraries or tonnes of code to manage. Proovl SMS API is the set of simple requests to build a communication between your solution and Proovl SMS services. Just a couple of code rows from examples below allows you to reach all the benefits of Proovl SMS.

Send SMS

Allows you to send messages through our high-throughput routes worldwide.

StringDescription
userthe user ID
tokenthe authentication token
routethe route
1 = Standard; 2 = Economy
fromthe phone number under your account
tothe receiver's phone number
textthe body of the message
idthe ID of the message in our network
statusthe current status of the message
PHP script example:
<?php

// Request sending

$url = "https://www.proovl.com/api/send.php";

$postfields = array(
'user' => "$user",
'token' => "$token",
'route' => "$route",
'from' => "$from",
'to' => "$to",
'text' => "$text"
);

if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);



// Handle the response

$result = explode(';',$output);

if ($result[0] == "Error") {
echo "Error message: $result[1]";
die;
} else {
echo "Message ID: $result[1]; Status: $result[0]";
}

?>

Receive SMS

You can associate your SMS Number with an URL, an E-mail address or a Phone number.

When someone sends a text message to your SMS Number, we make an HTTP request to your URL with following strings:

StringDescription
tokenthe authentication token
idthe ID of the message in our network
fromthe sender's phone number
tothe receiver's phone number
textthe body of the message

In case you have associated your SMS Number with an E-mail address, we will forward all incoming texts to your E-mail with the phone numbers of sender and receiver.

Once you've selected to forward messages to another cell number, our system will forward the SMS with a sender's phone number preceding the contents of the message.

PHP script example:
<?php

$id = $_REQUEST['id'];
$token = $_REQUEST['token'];
$from = $_REQUEST['from'];
$to = $_REQUEST['to'];
$text = $_REQUEST['text'];

if ($token == "[your_token]") {
echo "Thank you $from for sending $message";
} else {
echo "Incorrect token";
die;
}

?>

Check SMS status and price

Allows you to request current status and the price of SMS in system.

StringDescription
idthe ID of the message in our network
phonethe phone number under your account
statusthe current status of the message
pricethe price of message
PHP script example:
<?php

$id = $_REQUEST['id'];
$phone = $_REQUEST['phone'];

// Request sending

$url = "https://www.proovl.com/api/check.php";

$postfields = array(
'id' => "$id",
'phone' => "$phone"
);

if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);



// Handle the response

$result = explode(';',$output);

if ($result[0] == "Error") {
echo "Error message: $result[1]";
die;
} else {
echo "Message ID: $result[0]; Status: $result[1]; Price: $result[2]";
}

?>

Delivery reports

We will send a request to your script URL with new status for each sent SMS, every time when it will be updated.

StringDescription
idthe ID of the message in our network
tokenthe authentication token
statusthe current status of the message
(Sent; Delivered; Failed; Undelivered)
PHP script example:
<?php

$id = $_REQUEST['id'];
$token = $_REQUEST['token'];
$status = $_REQUEST['status'];

echo "Message ID: $id is: $status";
?>

Current balance

Allows you to request current balance.

StringDescription
userthe user ID
tokenthe authentication token
PHP script example:
<?php

$user = $_REQUEST['user'];
$token = $_REQUEST['token'];

$balance = file_get_contents("https://www.proovl.com/api/balance.php?user=$user&token=$token");

echo "Your account balance: $balance";

?>