We have set up an API system to allow users to send text messages through the website. An API system givs your software/website controlled access to our databases to make data exchange quick and hassle-free.
Bespoke text messages can also be sent manually through 'My Account' on our website.
In order to use this system please create your script and then contact us so that we may test and approve your script before going live on the system.
Sending your SMS messages
In order to send text messages through our API you first need to obtain your 'Secret Code' from your user profile on the website (found near the bottom of the page).
We have developed a strong error resistant API registration system which is easy to adopt for your systems.
There is an example of an API send using cURL (& PHP) if you require examples in other programming languages then please get in touch and we will do our best to provide examples to your company as soon as possible.
Required Data Fields
Data is sent to us via POST variables, you can specify upto 5000 numbers at any one time. All records are required except for 'whenToSend'.
For each record you need to provide the following data (validation information included):
- Username - Your username for this website.
- Secret Code - A secret code which can be found in your user profile.
- Password - Your password for this website.
- Message - The SMS message returned to clients. Note: Does not need to include contact information, or agency name. Please see our SMS writing guide for help (min 30 char., max 572 char.)
- whenToSend - The date and time that you wish the mesage to be sent. Note: Optional, blank or invalid datetime means that the message will be delivered immediately. Format: YYYY-MM-DD HH:MM:SS (Y = Year, M = Month, D = Day, H = Hour, M = Minute, S = Second)
- number - A comma seperated list of phone numbers that you wish the message to go to. Note: Maximum of 5000 numbers at any one time, numbers must begin with a '0' or '+44'.
If there is an error a message with the word 'ERROR' will be returned with a brief description following after a colon.
If the message is sent 'OK' is returned with the number of remaining credits following a colon.
Example
Below is an example of how to perform the API send using cURL and PHP. If you have any questions then please feel free to get in touch about the system. Once you have your API script written please contact us to obtain an upload address and to have your script tested/verified.
PHP Code:
//build url from variables
$data = "username=" . urlencode($username);
$data .= "secretCode=" . urlencode($secretCode);
$data .= "password=" . urlencode($password);
$data .= "number=" . urlencode($number);
$data .= "message=" . urlencode($message);
$data .= "whenToSend=" . urlencode($whenToSend);
$address = '< Provided upon request >'
//send messages
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://$address");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
//use this to suppress output
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($ch);
curl_close ($ch);












