User Management Operations
The Mattermost API Client provides several user-related operations through its UsersApi class.
Token Management
Create personal access tokens for users with descriptions. These tokens can be used for API authentication.
Password Management
Update user passwords with proper validation:
- Requires current password (unless bypassed)
- Validates new password isn't empty
- Handles password change requests securely
Technické informace
createToken()
- Parameters:
string $userId: Mattermost user IDstring $description: Token description- Returns:
Tokenobject - Throws:
ClientExceptionInterfacefor HTTP errorsJsonExceptionfor JSON parsing errorsApiExceptionfor Mattermost API errors
updateUserPassword()
- Parameters:
string $userId: Mattermost user IDstring $currentPassword: Current password (optional for admin)string $newPassword: New password- Returns: Operation status
- Throws:
InvalidArgumentExceptionfor invalid inputsClientExceptionInterfacefor HTTP errorsJsonExceptionfor JSON parsing errorsApiExceptionfor Mattermost API errors
The Token model represents token data with getters for all fields.