Retrieve the bounces of a campaign
Retrieve a type of recipient from a campaign
- bounces (NPAI)
- openers
- unsubscribers
- clickers
- inactive recipients
This function can only access campaigns that have already been sent.
array Extrait_Campagne( login, motdepasse, campagne, type)
Description
Retrieve the list of failed addresses (bounces) for campaign campagne.
Parameters (required)
login: customer ID (nichandle)
motdepasse: the password
campagne: campaign identifier (see List campaigns accessible via API to find the identifier associated with a campaign.
type: the type of extraction. This variable can take the following values:
NPAI(hard bounces)SOFT(soft bounces)OVERQUOTA(full mailboxes)ouvreurs(openers)desinscrits(unsubscribers)cliqueurs(clickers)inactifs(inactive recipients)
Return value
An array where each row contains an email address:
- [id] => email address
Error messages
No field must be left empty login
No field must be left empty motdepasse
Authentication error (invalid login / password)
No field must be left empty ope
No field must be left empty type
This campaign does not appear to belong to you
Unknown type value
Example with NuSOAP
include('nusoap/nusoap.php');
$client = new soapclient('https://www.eml-srv.com/_soap/control.php'); // Remove the 's' from 'https' if CURL is not installed
$parametres = array( 'login'=>'your_login', 'motdepasse'=>'your_password', 'ope'=>'3732', 'type'=>'NPAI' );
$variable=$client->call('Extrait_Campagne', $parametres);
// Retrieve the error, if any
if($client->fault)
die("Error:Code: {$client->faultcode}"
. "Detail: {$client->faultactor}"
. "Solution: {$client->faultstring}");
print_r($variable);Which gives a result like:
Array
(
[0] => support@ediware.net
[1] => info@ediware.net
)Example with PHP5
try { $client = new SoapClient(null, array('location' => "https://www.eml-srv.com/_soap/control.php", 'uri' => "https://www.eml-srv.com", 'encoding'=>'ISO-8859-1' ));
$variable = $client->Extrait_Campagne('your_login','your_password','3732','NPAI'); //or //$variable = $client->__soapCall(Extrait_Campagne,$parametres);
print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}