[Vtigercrm-developers] Create user with API in vtiger 7
iko
irina_k6 at hotmail.com
Sat Feb 3 08:40:13 GMT 2018
Hi, here is the script I am using
<?php
//create User using library
$moduleName = 'Users';
//fill in the details of the User. Creating userId is obtained from
loginResult.
$userData = array(
'user_name'=>'drwho',
'user_password'=>'drwho',
'confirm_password'=>'drwho',
'first_name'=>'Clara',
'last_name'=>'Oswald',
'phone_work'=>'123456789',
'roleid'=>'H1',
'email1' => 'norep at drwho.tld',
// you should define almost all the fields
'assigned_user_id'=>$cbUserID,
);
$create = $cbconn->doCreate($moduleName, $userData);
//check whether the requested operation was successful or not.
if($create) {
//operation was successful get the response.
var_dump($create);
} else {
echo "Create failed<br>";
$err = $cbconn->lastError();
echo $err['code'].': '.$err['message'];
}
?>
--
Sent from: http://vtiger-crm.2324883.n4.nabble.com/vtigercrm-developers-f4.html
More information about the vtigercrm-developers
mailing list