Skip to content

Retrieve the bounces of a campaign

By Mounir 2 min read

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

Examples

<?php
include('nusoap/nusoap.php');

$client = new soapclient('https://www.mdworks.info/_soap/control.php');
$params = [
    'login'      => 'your_login',
    'motdepasse' => 'your_password',
    'ope'        => 12345,
    'type'       => 'NPAI',
];

$emails = $client->call('Extrait_Campagne', $params);

if ($client->fault) {
    die("SOAP error: {$client->faultstring}");
}

print_r($emails);

Sample result:

Array
(
    [0] => support@example.com
    [1] => info@example.com
)
Last updated on