UserApi class provides comprehensive user management functionality including creating users, updating account information, managing deposits/withdrawals, and password resets.
Constructor
Guzzle HTTP client instance. If not provided, a new Client will be created.
SDK configuration object. If not provided, a new Configuration will be created.
Header selector instance. If not provided, a new HeaderSelector will be created.
Methods
getConfig
Retrieves the current configuration object.The current SDK configuration object
userAddPost
Creates a new trading user account.User object containing:
password_investor: Investor password (string)password: Main password (string)name: User name (string)email: User email address (string)group: Trading group name (string)leverage: Account leverage (int)
Object containing the created user’s details including the assigned login ID
\D4T\MT5Sdk\ApiException- On non-2xx response (200 success, 400 error)\InvalidArgumentException- When body parameter is missing
userAddPostWithHttpInfo
Creates a new user account with HTTP response details.User object with account creation parameters
Array containing:
- [0]:
\D4T\MT5Sdk\Models\UserReturnType- The created user details - [1]:
int- HTTP status code - [2]:
array- HTTP response headers
\D4T\MT5Sdk\ApiException- On non-2xx response\InvalidArgumentException- When body parameter is missing
userAddPostAsync
Asynchronously creates a new user account.User object with account creation parameters
Promise that resolves to
\D4T\MT5Sdk\Models\UserReturnType\InvalidArgumentException- When body parameter is missing
updateUser
Updates an existing user’s information.User object containing:
login: User login ID (int)password: New password (string, optional)name: New name (string, optional)- Other updatable user fields
\D4T\MT5Sdk\ApiException- On non-2xx response (400 error)\InvalidArgumentException- When body parameter is missing
updateUserWithHttpInfo
Updates user information with HTTP response details.User object with fields to update
Array containing:
- [0]:
null- No response body - [1]:
int- HTTP status code - [2]:
array- HTTP response headers
\D4T\MT5Sdk\ApiException- On non-2xx response\InvalidArgumentException- When body parameter is missing
userUserLoginGet
Retrieves user details by login ID.The user login ID to fetch
User object containing complete user information
\D4T\MT5Sdk\ApiException- On non-2xx response (200 success, 400 error)\InvalidArgumentException- When user_login is missing
userUserLoginDelete
Deletes a user account.The login ID of the user to delete
\D4T\MT5Sdk\ApiException- On non-2xx response (400 error)\InvalidArgumentException- When user_login is missing
userDepositPost
Deposits funds into a user’s account.Balance operation object containing:
login: User login ID (int)amount: Deposit amount (float)type: Operation type (int, typically 3)comment: Transaction comment (string)
\D4T\MT5Sdk\ApiException- On non-2xx response (400 error)\InvalidArgumentException- When body parameter is missing
userWithdrawPost
Withdraws funds from a user’s account.Balance operation object containing:
login: User login ID (int)amount: Withdrawal amount (float)type: Operation type (int, typically 3)comment: Transaction comment (string)
\D4T\MT5Sdk\ApiException- On non-2xx response (400 error)\InvalidArgumentException- When body parameter is missing
userResetPwdPost
Resets a user’s password.Password reset object containing:
login: User login ID (int)password: New password (string)change_investor: Whether to change investor password (int, 0 or 1)
\D4T\MT5Sdk\ApiException- On non-2xx response (400 error)\InvalidArgumentException- When body parameter is missing
usersGroupGet
Retrieves a list of user logins for a specific group.Group name to retrieve users from
Object containing an array of user login IDs belonging to the specified group
\D4T\MT5Sdk\ApiException- On non-2xx response (200 success, 400 error)\InvalidArgumentException- When group parameter is missing
Async Method Variants
All methods have async variants with the following naming patterns:methodNameAsync()- Returns a Promise resolving to the response objectmethodNameAsyncWithHttpInfo()- Returns a Promise resolving to [response, statusCode, headers]
\InvalidArgumentException for missing required parameters.