Create a sub-account

This function allows you to create a sub-account (note that this function is only available for reseller accounts).

int Add_User($login_user,$pass_user,$quota_forward,$login,$password)

  • $login_user : login of the new user
  • $pass_user : password of the new user
  • send_quota: allocated send quota
  • $login : reseller account login
  • password: password for the reseller account

Warning:

The SOAP server for user management is separate from the normal API:

https://www.eml-srv.com/_soap/serveur.php

Description

Create a new account and assign it a quota.

Settings (required)

All parameters are mandatory.

Back

An integer corresponding to the identification number of the new account:

  • num_user

The user ID of this new user must be stored on your side in order to modify his account and add a sending quota.

Error messages

No field should be left empty

No field should be left empty password

Intermediate error (wrong login / password)

No field should be left blank (new account IDs, quota).

This username already exists: please choose a new login

Quota too high / You don't 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'); // Enlever le 's' de 'https' si CURL n'est pas installé

$parametres = array( 'login_user'=>'demo_434', 'pass_user'=>'43fdg43', 'quota_envoi'=>'500', 'login'=>'votre_login', 'motdepasse'=>'votre_mot_de_passe' );

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

// Récupérer l'erreur le cas échéant if($client->fault)
die("Erreur:Code: {$client->faultcode}"
. "Détail: {$client->faultactor}"
. "Solution: {$client->faultstring}");

print_r($variable);

This gives a result of the type :

432

This number corresponds to the new user's ID.

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','votre_login','votre_mot_de_passe'); //ou //$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);

}

This post is also available in: Français (French)