Skip to main content

IUserApiClient

An interface in Alta.Api.Client, Alta.Api.Client.HighLevel.

The user account part of Alta's web API: user lookups, verification, roles and cosmetic presets. Reached through ApiAccess.ApiClient.UserClient. Every method except Logout makes a web request.

Properties​

MemberWhat it is
UserInfoWithPermissions LoggedInUserInfo { get; set; }The logged-in user's info and permissions. Set on login, null when logged out. No request.

Methods​

MemberWhat it is
Task ChangeEmail(string email)Requests an email change for the logged-in user.
Task ChangeUsernameAsync(string newUsername, string passwordHash)Requests a username change, confirmed with the password hash.
Task<UserPresetDataInfo> CreateCosmeticsPreset(int presetId, uint[] data, int byteSize)Saves a cosmetic preset (packed data and its byte size) under a preset id.
Task DeleteCosmeticPreset(int presetId)Deletes a saved cosmetic preset by id.
Task<IEnumerable<UserPresetDataInfo>> GetAllCosmeticsPresets()Fetches the logged-in user's saved cosmetic presets.
Task<MembershipStatusResponse> GetMembershipStatus(int userIdentifer)Fetches a user's membership (subscription) status.
Task<PersonalUserInfoResponse> GetPersonalUserInfo(int userIdentifier)Fetches a user's personal info response by user id.
Task<UserInfo> GetUserInfoAsync(int userId)Fetches a user's public info, by user id or by username.
Task<UserInfo> GetUserInfoAsync(string username)Fetches a user's public info, by user id or by username.
Task<UserInfoWithPermissions> GetUserInfoWithPermissionsAsync(int userId)Fetches a user's info along with their permissions.
Task<UserStatistics> GetUserStatisticsAsync(int userIdentifier)Fetches a user's statistics.
Task GiveUserRoleAsync(int userIdentifer, AssignableRoles role)Assigns one of the assignable roles to a user.
Task<bool> IsUserVerifiedAsync()Asks whether the logged-in user's email is verified, and marks the local info verified if so.
void Logout()Clears the low-level login tokens.
Task RefreshLoginAsync()Refreshes the login tokens.
Task RequestUserVerificationEmailAsync(string email)Asks for a verification email to be sent to the given address.
Task UpdatePasswordAsync(string oldPasswordHash, string newPasswordHash)Changes the password, from the old hash to the new hash.
Task ValidateEmail(string email)Asks the API whether an email address is acceptable.
Task<string> ValidateUsername(string username)Asks the API whether a username is acceptable, returning its answer as a string.
Task VerifyUsersMemberShip(int userId)Asks the API to verify a user's membership.

Used in​

Members of other types that take, return or hold a IUserApiClient: