<?php
$url = '';
$username = '';
$token = '';
$xml_data = '
<xmlrequest>
<username>' . $username . '</username>
<usertoken>' . $token . '</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>GetSubscriberByCustomField</requestmethod>
<details>
<customfields>
<item>
<fieldid>2</fieldid>
<value></value>
</item>
</customfields>
<searchinfo>
<List>
<array>1</array>
</List>';
// Filter by email
//$xml_data .= ' <Email></Email>';
// after, between (add EndDate), before, exact/exactly, not
/*$xml_data .= '
<DateSearch>
<filter>true</filter>
<type>after</type>
<StartDate>'.strtotime('2013-01-01 00:00:00').'</StartDate>
</DateSearch>
';*/
// opened newsletter
//$xml_data .= ' <Newsletter>1506</Newsletter>';
// status confirmed
$xml_data .= ' <Confirmed>1</Confirmed>';
// select on status bounced (b), active (a) or unsubscribed (u)
$xml_data .= ' <Status>a</Status>';
// select on format (h/t)
$xml_data .= ' <Format>h</Format>';
$xml_data .= '
</searchinfo>
<sortdetails>
<SortBy>emailaddress</SortBy>
<Direction>asc</Direction>
</sortdetails>
<pageid>1</pageid>
<perpage>10</perpage>
</details>
</xmlrequest>
';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_POST, true);
if (!ini_get('safe_mode') && ini_get('open_basedir') == '') {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
}
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml=' . $xml_data);
$pageData = curl_exec($ch);
if (!$pageData) {
echo "Error!: " . curl_error($ch);
echo "\n";
exit;
}
curl_close($ch);
echo($pageData);
?>
Opmerkingen
0 opmerkingen
U moet u aanmelden om een opmerking te plaatsen.