Manage User Accounts

Manage User Accounts

Users in the context of the control panel are owners of service objects a.k.a. customers or tenants.

AddUser

Creates a user account and sends confirmation to the user’s email.

Method: AddUser (UserInfo user, bool sendLetter)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: a userinfo structure

Return: Method returns ID of the created account or error code occurred during account creation.

UserExists

Gets a value indicating whether a username already exists.

Method: UserExists (string username)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: Username – username of the account;

Return: Method returns ID of the account.

AuthenticateUser

Gets a value indicating that provided credentials are correct.

Method: AuthenticateUser (string username, string password, string ip)

Endpoint: http://<Enterprise Server URL>/esAuthentication.asmx

Input:

  • Username – username of the account to authenticate
  • Password – password of the account to authenticate;
  • Ip – originating ip address

Return:

Method returns the following statuses: -109 – wrong username has been specified, -110 – wrong password has been specified, -105 – user account has been cancelled, -103 – user account still in pending status, 0 – user credentials specified are correct;

GetUserById

Gets user account details by ID specified;

Method: GetUserById (int userId)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: UserId – userId of the account;

Return: Method returns a userinfo structure

GetUserByUsername

Gets user account details by username specified;

Method: GetUserByUsername (string username)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: Username – username of the account;

Return: Method returns a userinfo structure

GetUsers

Gets all users for the specified owner. If you would like to obtain users recursively then set “recursive” parameter to “true”;

Method: GetUsers (int ownerId, bool recursive)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input:

  • UserId – userId of theowner ccount;
  • Recursive – to obtain users recursively then set “recursive” parameter to “true

Return: Method returns a list of userinfo structures

UpdateUser

Updates user account details. Returns status 0 if account updated successfully;

Method: UpdateUser (UserInfo user)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: UserInfo – a userinfo structure;

Return: Returns status 0 if account updated successfully

DeleteUser

Deletes user account from the database. Returns 0 if account deleted successfully;

Method: DeleteUser (int userId)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input: UserId – userId of the account;

Return: Returns 0 if account deleted successfully;

ChangeUserPassword

Changes user account password. Returns 0 if password changed successfully;

Method: ChangeUserPassword (int userId, string password)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input:

  • Username – username of the account
  • Password – password of the account

Return: Returns 0 if password changed successfully;

ChangeUserStatus

Changes user account current status. The following statuses available: 1 – Active, 2 – Suspended, 3 – Cancelled and 4 – Pending; Returns 0 if status changed successfully;

Method: ChangeUserStatus (int userId, UserStatus status)

Endpoint: http://<Enterprise Server URL>/esUsers.asmx

Input:

  • UserId – userId of the account;
  • Status – 1 – Active, 2 – Suspended, 3 – Cancelled and 4 – Pending

Return: Returns 0 if status changed successfully;