Skip to content

Create a campaign

By Mounir 1 min read

Ajout_Campagne
int Ajout_Campagne (id_campagne, login)

Description

Creates a new campaign and returns its identifier.

Parameters (required)

login: customer ID (nichandle)

motdepasse: the password

Return value

The campaign identifier id, or an error message.

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('http://www.mdworks.info/_soap/control.php');

$parametres = array( 'login'=>'your_login', 'motdepasse'=>'your_password' );

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

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

echo 'Response:'.$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->Ajout_Campagne('your_login','your_password'); //or //$variable = $client->__soapCall(Ajout_Campagne,$parametres);

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

}
Last updated on