Skip to content

List campaigns accessible via the API

By Mounir 2 min read

Liste_Campagnes_API accessible via the API
array Liste_Campagnes_API ( login, motdepasse)

Description

Retrieve the list of campaigns for the account identified by login and password.
Parameters (required)

login: customer ID (nichandle)
motdepasse: the password

Return value

An array where each row contains an array with the parameters of a campaign:
[id] => campaign identifier
[reference] => campaign reference (for your own use)
[date_creation] => unix timestamp
[date_envoi] => api
[return_path] => reply address
[gestion_npai] => 0
[nom_expediteur] => Ediware
[reply] => Return path and From
[objet] => message subject
[total_mail] => number of emails in the campaign database
[images_jointes] => 0 if images are downloaded from a server, 1 if images are embedded in the email
[lien_desinscription] => 0 if you manage the unsubscribe link yourself, 1 if it is managed by MDWorks

Error messages

No field must be left empty login. No field must be left empty motdepasse. Authentication error (invalid login / password).
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'
);

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

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

print_r($variable);

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->Liste_Campagnes_API('your_login','your_password','21','1184252482'); //or //$variable = $client->__soapCall(Liste_Campagnes_API,$parametres);
print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
Last updated on