Partner API Only
The createUser() method creates a new VerticalResponse User login account. To be valid, this account must be associated with a Company that does not already have a user associated with it. The best way to accomplish this is by immediately preceding the createUser() call with a createCompany() call and providing the resulting ID in the company_id field.
The createUser() method creates a new VerticalResponse User login account. To be valid, this account must be associated with a Company that does not already have a user associated with it. The best way to accomplish this is by immediately preceding the createUser() call with a createCompany() call and providing the resulting ID in the company_id field.
Input
session_id [xsd:string] (required)
Your API session id.
user [vrtypens:User]
The User object containing the information for this specific user.
send_activation_email [xsd:boolean]
Output
[xsd:int]
Examples
PHP
$vrapi->createUser( array(
'session_id' => $sid,
'user' => array(
'email_address' => 'email@address.com',
'company_id' => $companyID,
'password' => 'randomhash',
'first_name' => 'Peter',
'last_name' => 'Parker',
),
) );
Ruby
vr.createUser({
'session_id' => sid,
'user' => {
'email_address' => 'email@address.com',
'company_id' => companyID,
'password' => 'randomhash',
'first_name' => 'Peter',
'last_name' => 'Parker',
},
})
Java
User user = new User();
user.setEmail_address("email@address.com");
user.setCompany_id(companyId);
user.setPassword("randomhash");
user.setFirst_name("Peter");
user.setLast_name("Parker");
CreateUserArgs createUserArgs = new CreateUserArgs();
createUserArgs.setSession_id(sessionID);
createUserArgs.setUser(user);
int userId = 0;
userId = vr.createUser(createUserArgs);
C#/.NET
User objUser = new User();
objUser.email_address = "email@address.com";
objUser.company_id = intCompanyId;
objUser.company_idSpecified = true;
objUser.password = "randomhash";
objUser.first_name = "Peter";
objUser.last_name = "Parker";
createUserArgs objcUA = new createUserArgs();
objcUA.session_id = sessionId;
objcUA.user = objUser;
int intUserId = 0;
try
{
intUserId = objVR.createUser(objcUA);
}
catch (Exception e)
{
System.Console.WriteLine(e.Message);
}
