SIGN IN

Developers

Free Trial

contact-lists.get-recipients


XML Request Example   XML Response Example   PHP Example   GET Example  

This method returns recipients for a given contact list. You must have access to the list to carry out operations on it.

Parameters:
  • id - list identifier required in one of the two following formats:
    • integer - the list id as a numeric value, this can be found by requesting 'contact-lists.get' and using corresponding id values from the dataset
      OR
    • string - the list name EXACTLY as it is in the 'contact-lists.get' response.
  • 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.
  • status (optional) - enum (active, deleted, opt-out) - used to specify status of recipients to return.




XML Request Example

<?xml version='1.0'?>
<request>
	<interface>PHP</interface>
	<version>0.3</version>
	<key>API_KEY</key>
	<secret>API_SECRET</secret>
	<method>contact-lists.get-recipients</method>
	<params>
		<id>1076</id>
		<offset>0</offset>
		<limit>10</limit>
	</params>
</request>




XML Response Example

<?xml version='1.0'?>
<xml>
	<method>contact-lists.get-recipients</method>
	<total>3</total>
	<time>2009-12-21 23:05:02 GMT</time>
	<timestamp>1261436702 GMT</timestamp>
	<dataset>
		<data>
			<mobile>6140xxxxxxx</mobile>
			<firstname>John</firstname>
			<lastname>Doe</lastname>
			<datetime_entry>2009-12-11 00:34:23</datetime_entry>
			<dest_country>AU</dest_country>
			<bounce_count>0</bounce_count>
		</data>
		<data>
			<mobile>6140xxxxxxx</mobile>
			<firstname>Jane</firstname>
			<lastname>Doe</lastname>
			<datetime_entry>2009-11-26 13:10:56</datetime_entry>
			<dest_country>AU</dest_country>
			<bounce_count>0</bounce_count>
		</data>
		<data>
			<mobile>6140xxxxxxx</mobile>
			<firstname>Jim</firstname>
			<lastname>Citizen</lastname>
			<datetime_entry>2009-11-26 13:11:11</datetime_entry>
			<dest_country>AU</dest_country>
			<bounce_count>0</bounce_count>
		</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 = 1076;
$offset = 0;
$limit = 10;

// execute request
$methodResponse = $transmitsmsAPI->getContactListRecipients($id, $offset, $limit);

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

echo "This list has " . (string) $xml->total . " recipients<hr />";
foreach ($xml->dataset->data as $data) {
	echo (string) $data->firstname . ' has the following mobile number: ' . (string) $data->mobile . '<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://burstsms.com/api-wrapper/contact-lists.get-recipients?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10&id=LIST_ID