How to change an email through the API?

RafaARV

New member
Joined
Sep 17, 2010
Messages
3
I've been trying several days to change an email address for "x" user but I just can't get through this.
Does anyone knows how to do this?

I've tried the following:

/****************************/
$res=$this->serverConn->query('/CMD_MODIFY_USER',
array(
'user' => 'lalalala01',
'action' => 'update',
'evalue' => '[email protected]',
'email' => '1',
)
);

//The answer is "User Modified" with the "Details" section in blank but
//the email doesn't changes
/*****************************/



/****************************/
$res=$this->serverConn->query('/CMD_CHANGE_INFO',
array(
'domain' => 'lalalala01.com',
'evalue' => '[email protected]',
'email' => '1',
)
);

//The answer is "Error: document not found" and no change is made.
//I also tried setting the "email" field to "Save" but I get the same answer.
//If I use the "/CMD_API_CHANGE_INFO" command with the same
//parameters I get "NULL" as the answer and nothing happens
/****************************/


:confused::confused::confused::confused: Help!
 
I did it!

Ok, I finally did it! I'll post the answer for those people that have the same problem, because I couldn't find the answer in any place.
The way I got the answer was watching what does the HTML of DirectAdmin does.

The correct way of changing an user email with the API is:

$res=$this->serverConn->query('/CMD_MODIFY_USER',
array(
'user' => 'lalalala01', //The user name
'action' => 'single', //It is always 'single'
'evalue' => '[email protected]', //The new user email
'email' => 'Save E-Mail' //Its always 'Save E-Mail'
)
);


:):):):):)
 
Back
Top