Resellers - Create a sub-account
Create a sub-account
This function lets you create a sub-account (note: only available for reseller accounts).
int Ajout_Utilisateur($login_user, $pass_user, $quota_envoi, $login, $motdepasse)
$login_user: login of the new user
$pass_user: password of the new user
$quota_envoi: assigned sending quota
$login: login of the reseller account
$motdepasse: password of the reseller account
Warning:
The SOAP server for user management is separate from the regular API:
https://www.eml-srv.com/_soap/serveur.php
Description
Create a new account and assign it a quota.
Parameters (required)
All parameters are required.
Return value
An integer corresponding to the identifier of the new account:
- num_user
The identifier of this new user must be stored on your side so you can edit the account and add a sending quota later.
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 (new account identifiers, quota).
This username already exists: please choose a new login
Quota too high / You do not have enough quota to assign this credit to your new user.
Example with NuSOAP
include('nusoap/nusoap.php');
$client = new soapclient('https://www.eml-srv.com/_soap/serveur.php'); // Remove the 's' from 'https' if CURL is not installed
$parametres = array( 'login_user'=>'demo_434', 'pass_user'=>'43fdg43', 'quota_envoi'=>'500', 'login'=>'your_login', 'motdepasse'=>'your_password' );
$variable=$client->call('Ajout_Utilisateur', $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:
432This number is the identifier of the new user.
Example with PHP5
try { $client = new SoapClient(null, array('location' => "https://www.eml-srv.com/_soap/serveur.php", 'uri' => "https://www.eml-srv.com", 'encoding'=>'ISO-8859-1' ));
$variable = $client->Ajout_Utilisateur('demo_434','43fdg43','500','your_login','your_password'); //or //$variable = $client->__soapCall(Ajout_Utilisateur,$parametres);
print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}