SIGN IN

Developers

Free Trial

messages.single


XML Request Example   XML Response Example   PHP Example   GET Example  

This method will send a single SMS and does not require the recipient be on one of your contact lists. This method does not accept custom variables, to achieve that you will have to upload users in a contact list and send to that.

Parameters:
  • mobile - string (numbers only) - recipients mobile number in INTERNATIONAL format.
  • message - string - the sms body, user variables are not available in this method.
  • caller_id - string - required in one of the two following formats:
    • numeric - up to 15 numeric characters (e.g. your mobile number if you want replies to come straight to your phone).
    • string - maximum of 11 characters, a-z, 0-9 and _ are valid characters, no spaces.
  • sendtime - integer - Unix Timestamp in GMT for when to send the message. If not supplied the message is sent immediately
  • contact_list - integer - specify a contact list id if you want to save this number to that list
  • validity - integer - the maximum number of minutes to attempt sending the message (1-4320)




XML Request Example

<?xml version='1.0'?>
<request>
	<version>0.3</version>
	<key>API_KEY</key>
	<secret>API_SECRET</secret>
	<method>messages.single</method>
	<params>
		<mobile>614xxxxxxx</mobile>
		<message>Hi!</message>
		<caller_id>614xxxxxxx</caller_id>
		<sendtime />
		<contact_list />
	</params>
</request>




XML Response Example

<?xml version='1.0'?>
<xml>
	<method>messages.single</method>
	<total>1</total>
	<time>2009-12-10 06:09:15 GMT</time>
	<timestamp>1260425355 GMT</timestamp>
	<data>
		<message>queued</message>
		<contact_list_addition>no list provided</contact_list_addition>
		<message_id>123</message_id>
	</data>
</xml>




PHP Example

Download the PHP API Client

<?php

// change api key and secret to your own
$myAPIKey = "API_KEY";
$myAPISecret = "API_SECRET";

// include base class
require('APIclient.php');

// create new client object
$transmitsmsAPI = new transmitsmsAPI($myAPIKey, $myAPISecret);

// set parameters
$mobileIntFormat = "614xxxxxxx";
$body = 'my sms body';
$caller_id = 'John';

// execute request
$methodResponse = $transmitsmsAPI->SMS($mobileIntFormat, $body, $caller_id);

// parse response into xml object
$xml = @simplexml_load_string($methodResponse);

echo ((string) $xml->data->result == 'queued') ? "Message was added" : "Message was not added: " . (string) $xml->data->message;

?>




GET Example

Using a URL based request system you can request this method by using the below URL - be sure to url encode all your variables!

http://burstsms.com.au/api-wrapper/messages.single?apikey=API_KEY&apisecret=API_SECRET&mobile=RECEIPIENT_MOBILE&message=MY_SMS_MESSAGE&caller_id=ME&sendtime=1264638377&contact_list=LIST_ID