Fab1en / rocket-chat-rest-client

Rocket Chat REST API client in PHP
49 stars 38 forks source link

How to create a user? #14

Open 1th opened 6 years ago

1th commented 6 years ago

image

Fab1en commented 6 years ago

I don't understand your question. Could you please be a little bit more wordy ? User creation is shown in the doc


// create a new user
$newuser = new \RocketChat\User('new_user_name', 'new_user_password', array(
    'nickname' => 'New user nickname',
    'email' => 'newuser@example.org',
));
if( !$newuser->login(false) ) {
    // actually create the user if it does not exist yet
    $newuser->create();
}
1th commented 6 years ago
// create a new user
$newuser = new \RocketChat\User('new_user_name', 'new_user_password', array(
    'nickname' => 'New user nickname',
    'email' => 'newuser@example.org',
));
if( !$newuser->login(false) ) {
    // actually create the user if it does not exist yet
    $newuser->create();
}

return "Unauthorized"

dkyiev commented 4 years ago

After 2 years and it's still the same. The user is created, but returns the message "Unauthorized".