Skip to content
Retrieve bounces, openers, clickers, unsubscribers or inactives of an API-managed campaign since a given date

Retrieve bounces, openers, clickers, unsubscribers or inactives of an API-managed campaign since a given date

By Mounir 2 min read

Retrieve a type of recipient from a campaign since a given date

Warning: this function only works with an API-managed campaign (sent on the fly).

  • bounces (NPAI)
  • openers
  • unsubscribers
  • clickers
  • inactive recipients

This function can only access campaigns that have already been sent.

array Extrait_Campagne_Limit( login, motdepasse, campagne, type, limit)

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 extraction type. 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)

limit: the time window in seconds (for example, to retrieve data from the last 24 hours, limit = 24 * 3600 = 86400)

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

No field must be left empty limit

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', 'limit'=>'86400' );

$variable=$client->call('Extrait_Campagne_Limit', $parametres);

// Retrieve the error, if any
if($client->fault)
die("Error:Code: {$client->faultcode}"
. "Detail: {$client->faultactor}"
. "Solution: {$client->faultstring}");

print_r($variable); </source>

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_Limit('your_login','your_password','3732','NPAI', '86400'); //or //$variable = $client->__soapCall(Extrait_Campagne_Limit,$parametres);

print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);

}
Last updated on