We created a new viewing experience for our SMS API documentation. It's now all in one central location. Click here to check it out!

This method returns your message delivery results.


Parameters:


  • id - integer - message ID.
  • offset - integer - used to specify where to start reading from in the data set - 0 being the first item.
  • limit - integer - used to specify maximum number of records to return. 0 disables any limit but should only be used for small data sets.


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<interface>PHP</interface>

	<version>0.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>messages.delivery</method>

	<params>

		<id>1111</id>

		<offset>0</offset>

		<limit>4</limit>

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>messages.delivery</method>

	<total>2</total>

	<time>2009-12-21 23:08:45 GMT</time>

	<timestamp>1261436925 GMT</timestamp>

	<dataset>

		<data>

			<mobile>614000000</mobile>

			<firstname>John</firstname>

			<lastname>Doe</lastname>

			<smpp_delivery_result>ok</smpp_delivery_result>

			<datetime_send>2011-05-02 00:35:56</datetime_send>

			<datetime_result>2011-05-02 01:41:00</datetime_result>						

		</data>

		<data>

			<mobile>614000001</mobile>

			<firstname>Jane</firstname>

			<lastname>Doe</lastname>

			<smpp_delivery_result>hard bounce</smpp_delivery_result>

			<datetime_send>2011-05-02 00:35:56</datetime_send>

			<datetime_result>2011-05-02 01:41:00</datetime_result>			

		</data>

	</dataset>

</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

$id=1111;

$offset = 0;

$limit = 4;



// execute request

$methodResponse = $transmitsmsAPI->getMessageDelivery($id, $offset, $limit);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



echo 'There are ' . $xml->total . ' SMS<hr />';

foreach ($xml->dataset->data as $message) {

	echo 'Message to phone' . (string) $message->mobile . ' is ' . (string) $message->smpp_delivery_result=='OK'?'':'not ' . 'delivered<br />';

}



?>






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://burst.transmitsms.com/api-wrapper/messages.delivery?apikey=API_KEY&apisecret=API_SECRET&id=1111&offset=0&limit=10