CPlugin

MT5 v2 :: Common

API v2 (current) · MT5 · 2 operations · base URL https://cloud.mywebapi.com · OpenAPI v2 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token (scope webapi). The token server belongs to the environment: for the Sandbox call https://pre.mywebapi.com and take the token from https://pre.auth.cplugin.net/connect/token; for Production take it from https://auth.cplugin.net/connect/token. Clients and tokens of the two are separate — a token from one answers 401 on the other. $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox. A failed operation is also answered with HTTP 200: check error before using data. Access and transport failures use HTTP codes — see Errors.

Operations

Get server time

GET /api/v2/MT5/{tradePlatform}/TimeServer

Returns the current time of the trade server. The call only reads and changes nothing. It requires a connection to the trade platform; without one the call is answered with a "not connected" error.

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/TimeServer" \
  -H "Authorization: Bearer $TOKEN"

Get server time configuration

GET /api/v2/MT5/{tradePlatform}/TimeGet

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.

Responses

Example

curl "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/TimeGet" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.

DateTimeApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data string (date-time)
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5TimeApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Time Server time configuration (the platform's server-time settings), v2 read record.
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

ApiError

v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.

PropertyTypeDescription
code WebApiErrorCode Stable transport-level error code.
managerCode ResultCode Raw MT4 result code when ApiError.Code is MT4Error; null otherwise. On MT5 the result name is in ApiError.Message.
message string, nullable Human-readable error description.

ApiMeta

Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

PropertyTypeDescription
activityId string, nullable W3C trace id of the request. Quote it when you contact support: it finds this exact call in the server logs.
paging PagingMeta Pagination info; present only on list responses, omitted otherwise.

MT5Time

Server time configuration (the platform's server-time settings), v2 read record.

PropertyTypeDescription
timeZone integer (int32) Server time zone, minutes from GMT (0 = GMT, 60 = GMT+1).
timeServer string, nullable Time synchronization server address (TIME/NTP).
daylight boolean Daylight saving time mode enabled.
daylightState integer (int32) Daylight saving state (0 = no DST in zone, non-zero otherwise).