Dashboard

Sending SMS via HTTP

Send an SMS text message to a mobile phone.

SMS is standard GSM 7-bit and should conform to the GSM ASCII character set.

We recommend sending to no more than 500 comma separated numbers in a single API call.

For UK mobiles the number should begin 447 or 07. For non-UK mobiles the number should begin with the country code. The number should never contain a "+" at the beginning.

By default we assume clients do not encode their messages as UTF8 when passing them to the SMS Expert API. However if you wish to do this then please inform us so that we can switch your account to handle UTF8 encoding.
https/post callhttps://secure.itagg.com/smsg/sms.mes
parameters$usr, $pwd [as supplied during account signup]

$from [alpha/numeric upto 11 chars, shortcode or mobile number]

$to [mobile number or list of comma separated numbers]

$type {"text"}

$route {"p", "g", "l", "d", "e"} [please ask us for correct code to use]

$txt [message to send to phone. must be urlencoded]
optional

(long sms)
No changes are required to send SMS longer than 160 characters and upto 1,377 characters in length.

SMS longer than 160 characters is billed "per 153 characters".
optional

(scheduling)
Use this optional parameter to schedule sms sending for a specific future date and time. If omitted then sms is sent immediately.

$send {yyyymmddhhmmss}

The format of the send parameter is yyyymmddhhmmss, which relates to Year, Month, Date, Hours, Minutes, Seconds. Each of these elements must contain a leading zero.

Example... 16:07:08 on 9th March 2015 is 20150309160708

Do not use both scheduling options together.
optional

(scheduling 2)
Use this optional parameter to specify how many seconds to wait "from now" before sending the sms.

$sendrelative [number of seconds into the future to send sms]

Do not use both scheduling options together.
optional

(receipts)
Use this optional parameter to override the default delivery receipt URL (configured in the SMS Expert dashboard).

$dreceipt_url [set this to a valid URL]

The above URL can optionally contain a user defined parameter which is logged in the SMS Expert system and available in the delivery receipt API.

... &userid [optional. set this to any value as required]

Example...
dreceipt_url=http://www.mydomain.com/handler.php?userid=myid

Click here to read more about delivery receipts.
API response This function will return error/status response codes and messages as plain text on two rows. The first row is simply a header row.

The second row consists of a 3 values each separated by a "|" pipe character: error code, error text and submission reference.

error code|error text|submission reference
0|sms submitted|eb725f96b4b094d5f8318741cc1a545f-2


If the error code indicates a failure (any non-zero value) then the submission reference should be ignored.

If the error code is "0" (zero) this indicates a success and the submission reference should be recorded so that it can be matched up in future with the delivery receipt.

The submission reference will consist of a 32 character reference followed by a dash and then a single digit. Only the 32 character reference is required when matching up the delivery receipt.

At the time of writing the following are the available error codes and associated messages...

    0|sms submitted|[32 characters]-[1 character]
    1|bad user details|0
    2|missing or invalid fields|0
    2|missing or invalid fields (no text)|0
    2|missing or invalid fields (too many text characters)|0
    2|missing or invalid fields (invalid long message)|0
    2|missing or invalid fields (type is blank)|0
    3|invalid route|0
    100|submission failed (unable to queue message for sending)|0
    101|submission failed (unknown countrycode)|0
    102|submission failed (insufficient funds)|0
    301|invalid msisdn alias|0
examplehttps://secure.itagg.com/smsg/sms.mes?usr=XXX&pwd=YYY&from=myname&to=447912345678,447987654321&type=text&route=d&txt=helloworld
in a browserPaste the example into your browser & modify the parameters

Sample Code...
PHP

<?php
function sendsms($usr, $pwd, $orig, $dest, $txt, $dlrurl = "") {

  $url = "https://secure.itagg.com/smsg/sms.mes";

  if ($dlrurl != "") {$dlrurl = "&dreceipt_url=$dlrurl";}

  $params = "usr=$usr&pwd=$pwd&from=$orig&to=$dest&type=text&route=d&txt=".urlencode($txt);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $params.$dlrurl);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $returned = curl_exec($ch);
  curl_close($ch);

  $ret = explode("\n", $returned); $ret = explode("|", $ret[1]);

  print("Full response: $returned<br><br>-----<br><br>error code: ".$ret[0]."<br>error text: ".$ret[1]."<br>submission reference: ".$ret[2]."<br><br>-----<br><br>");

  if ($ret[0] == 0) {print("Success<br>");} else {print("Fail (".$ret[1].")<br>");}
}

//set to your delivery receipt handler URL and add id if needed
$dlrurl = "http://www.mydomain.com/dlr_handler.php?userid=myid";

//set XXX and YYY to your SMS Expert username and password
sendsms("XXX", "YYY", "SMSExpert", "447123456789", "hello", $dlrurl);
?>

Support Home
Introduction

Main dashboard
Campaign manager
SMS Expert home page
Sending SMS (http)
Send outbound SMS
Receive delivery receipts
Sending SMS (smpp)
Please call for details
Receiving SMS
Receive inbound SMS
Wallet Balances
SMS + keyword balances
Keyword Tools
Keyword availability
Register keyword
Set keyword forwarding

List keywords
Renew keyword
Delete keyword
Replace keyword

Tool response codes