This method modifies the properties of the user identified by the userId parameter. Call this method whenever your user's profile changes.
<?php
require_once(dirname( __FILE__ ) . "/ChatweeV2_SDK/Chatwee.php");
ChatweeV2_Configuration::setApiUrl(YOUR_API_URL);
ChatweeV2_Configuration::setChatId(YOUR_PERSONAL_CHAT_ID);
ChatweeV2_Configuration::setClientKey(YOUR_PERSONAL_CLIENT_KEY);
try {
ChatweeV2_SsoManager::editUser(Array(
"userId" => "507f191e810c19729de860ea"
"login" => "New user name",
"isAdmin" => true,
"avatar" => "http://mypage.com/new_avatar.png"
));
echo "The user has been edited";
} catch(Exception $exception) {
echo "An error occured: " . $exception->getMessage();
}
?>
Name | Description | Type | Mandatory | Remarks |
---|---|---|---|---|
userId | ID of the user | string | yes | - |
login | user login | string | yes | - |
isAdmin | if user has admin role | boolean | no | - |
avatar | user avatar | string | no | an absolute URL of the user's avatar image |