addSingleUserAcct($session_id, $first_name, $last_name, $user_name, $domain_name, $password, $birth_date, $alt_email, $zipcode, $regid)
addSingleUserAcct should be called when a max md user needs to add an email user for a given domain. It can be retrieved via a soap request using the "addSingleUserAcct" method to https://api.max.md/addSingleUserAcct.php?wsdl.
Response
(string) code - A response code. This will be "000" if there is no error
(string) message - A description of the reponse code
(string) values - For future use
Sample Code (using NuSoap)
$login_wsdl = "https://api.max.md/login.php?wsdl"; $soap = new soapclient($login_wsdl,array( 'trace' => true, 'exceptions' => true, )); //Login to get a session id $response = $soap->login($username, $password); // $response will return an object // stdClass Object // ( // [code] => 000 // [message] => Login successful! // [values] => Array // ( // [0] => c6c02ef92aa0dcb6c333a27cfb22d47c // [1] => 4297 // [2] => Reseller // [3] => 220 // [4] => // [5] => // ) // ) // The array "value" contains a reseller information like below: // // values = array( // [0] => session_id // [1] => user_id // [2] => user_type // [3] => reseller_id // ) $session_id = $response->values[0]; $reg_id = $response->values[3]; $addUser_wsdl = "https://api.max.md/addSingleUserAcct.php?wsdl"; $soap_adduser = new soapclient($addUser_wsdl, array( 'trace' => true, 'exceptions' => true, )); //addUser $response_add = $soap_adduser->addSingleUserAcct($session_id, "Michael", "Smith", "msmith", "maxsecuremail.com", "password", date('Y-m-d'), 'test@mdemail.md', 07024, $reg_id); if ($response_add->code == '000') { echo $response_add->message; }else{ echo $response_add->message; }
The response code should look like the following:
Success: - "000": User 'msmith' attribute 'pw' successfully set Failure: - "ApiSess-001": User not allowed to use the API - "S.U.M.E.001": The email already exists - "S.U.M.E.002": Problems with email provision - "S.U.M.E.004": Database Exception
The xml for the WSDL can be found here