This method returns recipients for a given contact list. You must have access to the list to carry out operations on it.
Parameters:<?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 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
// 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 />';
}
?>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