BasicApi class provides fundamental operations for connecting to and managing MetaTrader 5 server connections.
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
initGet
Initializes a connection to the MetaTrader 5 server and returns an authentication token.MetaTrader5 server IP with port. Example:
127.0.0.1:443MetaTrader manager login
MetaTrader manager password
Connection timeout in milliseconds
Object containing the authentication token and connection details
\D4T\MT5Sdk\ApiException- On non-2xx response\InvalidArgumentException- When required parameters are missing
initGetWithHttpInfo
Initializes a connection and returns response with HTTP information.MetaTrader5 server IP with port. Example:
127.0.0.1:443MetaTrader manager login
MetaTrader manager password
Connection timeout in milliseconds
Array containing:
- [0]:
\D4T\MT5Sdk\Models\InitReturnType- The response object - [1]:
int- HTTP status code - [2]:
array- HTTP response headers
\D4T\MT5Sdk\ApiException- On non-2xx response\InvalidArgumentException- When required parameters are missing
initGetAsync
Asynchronously initializes a connection to the MetaTrader 5 server.MetaTrader5 server IP with port. Example:
127.0.0.1:443MetaTrader manager login
MetaTrader manager password
Connection timeout in milliseconds
Promise that resolves to
\D4T\MT5Sdk\Models\InitReturnType\InvalidArgumentException- When required parameters are missing
initGetAsyncWithHttpInfo
Asynchronously initializes a connection with HTTP information.MetaTrader5 server IP with port. Example:
127.0.0.1:443MetaTrader manager login
MetaTrader manager password
Connection timeout in milliseconds
Promise that resolves to an array containing response object, status code, and headers
\InvalidArgumentException- When required parameters are missing
pingGet
Pings the API to verify connectivity.Object containing ping response data
\D4T\MT5Sdk\ApiException- On non-2xx response (including 400 Bad Request)\InvalidArgumentException- On invalid arguments
pingGetWithHttpInfo
Pings the API and returns response with HTTP information.Array containing:
- [0]:
\D4T\MT5Sdk\Models\PingReturnType- The response object - [1]:
int- HTTP status code - [2]:
array- HTTP response headers
\D4T\MT5Sdk\ApiException- On non-2xx response (200 success, 400 error)\InvalidArgumentException- On invalid arguments
pingGetAsync
Asynchronously pings the API.Promise that resolves to
\D4T\MT5Sdk\Models\PingReturnType\InvalidArgumentException- On invalid arguments
pingGetAsyncWithHttpInfo
Asynchronously pings the API with HTTP information.Promise that resolves to an array containing response object, status code, and headers
\InvalidArgumentException- On invalid arguments